protected override void OnModelCreating(DbModelBuilder builder) { builder.ApplyEntityConfiguration(); builder.ApplyValueObjectConfiguration(); builder.ApplyAuditableConfiguration(); builder.Conventions.Remove <PluralizingTableNameConvention>(); builder.Conventions.Remove <PluralizingEntitySetNameConvention>(); builder.Properties <string>().Configure(x => x.IsUnicode(true)); builder.Configurations.AddFromAssembly(GetType().Assembly); }
protected override void OnModelCreating(DbModelBuilder builder) { builder.ApplyEntityConfiguration(); builder.ApplyValueObjectConfiguration(options => { options.Configure = (typeConfiguration) => { foreach (var property in typeConfiguration.ClrType.GetProperties(BindingFlags.Public | BindingFlags.Instance)) { typeConfiguration.Property(property).HasColumnName(property.Name); } }; }); builder.ApplyAuditableConfiguration(); builder.Conventions.Remove <PluralizingTableNameConvention>(); builder.Conventions.Remove <PluralizingEntitySetNameConvention>(); builder.Properties <string>().Configure(x => x.IsUnicode(true)); builder.Configurations.AddFromAssembly(GetType().Assembly); }