All my entities inherit from a base class that contains a private RowVersion property. I am trying to configure a custom convention and I receive the following error:
"The property 'RowVersion' is not a declared property on type 'CustomerResponse'. Verify that the property has not been explicitly excluded from the model by using the Ignore method or NotMappedAttribute data annotation. Make sure that it is a valid primitive property."
Here is my convention:
public sealed class RowVersionConvention : Convention
{
public RowVersionConvention()
{
Types().Having(t => t.BaseType.GetProperty("RowVersion", BindingFlags.SetProperty | BindingFlags.GetProperty | BindingFlags.NonPublic | BindingFlags.Instance))
.Configure((config, property) =>
{
config.Property(property).IsRowVersion();
});
}
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Add(new RowVersionConvention());
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
}
Any help would be greatly appreciated!