コード例 #1
0
 public FormulaAttributeConvention(global::NHibernate.Cfg.Configuration configuration, IDatabaseTypeAccessor databaseTypeAccessor)
 {
     _databaseTypeAccessor = databaseTypeAccessor;
     _namingStrategy       = configuration.NamingStrategy;
 }
コード例 #2
0
        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));
                }
            }));
        }