I use Domain Driven Design Pattern in my project. I have some ValueObjects like PersianDate that has a long type property. the name of ValueObject property in database be CreatedOn_PersianDate but I want its name be CreatedOn. I can change this property directly but how can i do it by conventions? (FixOValueObjectAttributeConvention)
public class PersianDate : ValueObject<PersianDate>
{
public long Value {get; set;}
}
public class Account : Entity
{
public int Id {get; set;}
public PersianDate CreatedOn {get; set;}
}
public class TestContext : DbContext
{
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Add(new FixObjectValueAttributeConvention());
base.OnModelCreating(modelBuilder);
}
}