I've the following table definition in MSSQL:
CREATE TABLE [User] (
[Id] bigint identity(1,1) NOT NULL,
[Email] nvarchar(256),
[PasswordHash] nvarchar(128) NOT NULL,
[PasswordFormat] int DEFAULT ((0)) NOT NULL,
[PasswordSalt] nvarchar(10) NOT NULL,
[Timestamp] timestamp
)
;
The EDMX property for Timestamp looks like this: (Note only the red property has been manually changed by me)
I used the t4 template to automatically generate POCO entities. The User entity looks like this:
public partial class User : IEntity
{
public virtual long Id
{
get;
set;
}
...
[TimestampAttribute]
[ConcurrencyCheck]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Autogenerated by T4.")]
public virtual byte[] Timestamp
{
get;
set;
}
...
}
When doing a 'SaveChanges' operation on the ObjectContext, I get a validation error for the User entity which is called : The Timestamp field is required