public AllCapsTableAndColumnConvention() { var ps = (IPluralizationService)DbConfiguration.DependencyResolver.GetService(typeof(IPluralizationService), null); this.Types().Configure(t => t.ToTable(Identifiers.CreateIdentifier(ps.Pluralize(t.ClrType.Name)))); this.Properties().Configure(p => p.HasColumnName(Identifiers.CreateIdentifier(p.ClrPropertyInfo.Name))); }
public void Apply(AssociationType association, DbModel model) { // Identify ForeignKey properties (including IAs) if (association.IsForeignKey) { // rename FK columns var constraint = association.Constraint; foreach (var p in constraint.FromProperties.Union(constraint.ToProperties)) { p.Name = Identifiers.CreateIdentifier(p.Name); } } }