.net – Entity Framework code first with TimeStamp type

asp.net-4.0entity-frameworkentity-framework-5netsql-server-2008

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

Best Answer

You should declare your time stamp property as follows in your code first class:

[Timestamp] 
public Byte[] MyTimestamp { get; set; }