I'm using Entity Framework 6
to map a Table with a "datetime" column mapped on a property like this "public System.DateTime DATAOPER { get; set; }
"
This is the code first mapping:
this.Property(p => p.DATAOPER).HasColumnName("DATAOPER").HasColumnType("datetime").IsRequired();
I set the porperty with DateTime.Now
but the INSERT
statement generated is:
INSERT [dbo].[Tworkdom]([DATAOPER]) VALUES (@0)
parameter name: @0 parameter value: '13/12/2013 12:55:29'
It loses milliseconds information. I want instead a '13/12/2013 12:55:29.999'
for example