IsRowVersion can only be configured for Byte array properties

c# ef-code-first entity-framework entity-framework-6

Question

I recently used the NuGet updater to move from EntityFramework 5 to 6. I developed and ran my program, and everything appeared to go smoothly. I encountered the following issue when attempting to fetch the first entity from the database:

The property 'UpdatedDate' is not a Byte array. IsRowVersion can only be configured for Byte array properties.

The line of code to which it alludes is as follows:

[Timestamp]
public virtual DateTime UpdatedDate { get; set; }

I attempted to remove the timestamp attribute, but I still received the same issue. How can I fix this so that I can use EF6 to run my application?

1
5
12/4/2013 6:35:25 PM

Accepted Answer

EF attributes

If you employ[TimeStamp] attribute, then byte[] should be the specified property.
Then, in SQL Server, this is mapped to Rowversion.

if you desire a different field type to be used as a concurrency field. The property is used.[ConcurrencyCheck]

10
12/12/2013 3:08:01 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow