I am using SQL Server 2008 R2 and Entity Framework 5.0. When the database is generated, I cannot add my property of type TimeStamp without having the following error: There is no store type corresponding to the conceptual side type
'Edm.Time(Nullable=True,DefaultValue=,Precision=)' of primitive type 'Time'.
I have set the Entity Configuration to the type time or timestamp without success
Property(x => x.RestBetweenSet).HasColumnType("timestamp");
When I go in the Sql Server Management Studio and edit the table I can set a column of timestamp.
What do I need to do to have Entity Framework code first be able to generate this column?
Thank you
You should declare your time stamp property as follows in your code first class:
[Timestamp]
public Byte[] MyTimestamp { get; set; }
For the moment, I map to a INT64 and ignore the TimeStamp. Like in this post.
If they are better solutions, feel free to add. I won't accept my answer yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With