public FormulaAttributeConvention(global::NHibernate.Cfg.Configuration configuration, IDatabaseTypeAccessor databaseTypeAccessor) { _databaseTypeAccessor = databaseTypeAccessor; _namingStrategy = configuration.NamingStrategy; }
public static FluentConfiguration AddConventions(this FluentConfiguration fluentConfiguration, IDatabaseTypeAccessor databaseTypeAccessor) { var cfg = (global::NHibernate.Cfg.Configuration)fluentConfiguration.GetMemberValue("cfg"); return(fluentConfiguration.Mappings(m => { foreach (var persistenceModel in m.AutoMappings) { persistenceModel.Conventions.AddFromAssemblyOf <NotNullConvention>(); persistenceModel.Conventions.Add(typeof(FormulaAttributeConvention), new FormulaAttributeConvention(cfg, databaseTypeAccessor)); } })); }