I am using EF4 and creating classes through the Entity design surface then generating the database from them. I want to add an attribute to some of the classes to show the timestamp they were last updated.
I have added a Version attribute to them, but I don’t know which .Net datatype to associate with them so they become either Timestamp or RowVersion in the database when it is generated.
Any ideas?
You use
byte[]type for rowversion/timestampExample use: http://www.ienablemuch.com/2011/07/using-checkbox-list-on-aspnet-mvc-with_16.html
If you are in the designer, just type in
byte[]orSystem.Byte[], I think the field types dropdown selection on EF designer can be typed-in upon.Given this DDL
This is the class mapping: