I have a some field of entity
public virtual Trailer TempTrailer { get; set; }
How to change this fields value to null? I used:
var temptrailer = model.TempTrailer != null ?
await trailerService.FindByIdAsync(model.TempTrailer.Id) :
null;
entity.TempTrailer = temptrailer == null ? null : temptrailer;`
but does not accept null values. How to resolve this problem?
Traileris astruct? Structs can't benull. So if you need to assign anullvalue, change the type fromstructtoclassor change the declared type fromTrailertoTrailer?orNullable<Trailer>