I have created a SQL table and an EF Fluent mapping as follows:
CREATE TABLE [dbo].[Application] (
[ApplicationId] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (50) Not NULL,
[DataVersion] ROWVERSION,
CONSTRAINT [PK_dbo.Application] PRIMARY KEY CLUSTERED ([ApplicationId] ASC)
);
My EF Fluent API looks like this:
public class ApplicationConfiguration : EntityTypeConfiguration<Application>
{
public ApplicationConfiguration()
{
Property(a => a.Name)
.IsRequired()
.HasMaxLength(35);
Property(p => p.RowVersion).IsRowVersion();
}
}
My Class looks like this:
public class Application
{
public int ApplicationId { get; set; }
public string Name { get; set; }
public virtual ICollection<TestAccount> TestAccounts { get; set; }
xxxxxxx
}
Can someone tell me how I can define the RowVersion in my class?