I have a Datetime property in my model that looks like this:
[DataType(DataType.Date)]
[Column(TypeName = "date")]
public DateTime SubmittedOn { get; set; }
The value is inserted as a Date into the db, without the time portion. However, the server returns it with the time portion when the value is requested like this "2020-04-03T00:00:00"
How can I use modelBuilder
in my dbContext
to remove the time portion when the value is returned?
modelBuilder.Entity<Model>()
.Property(e => e.SubmittedOn)
.HasConversion(...?)