当前位置: 首页>>代码示例>>C#>>正文


C# Configuration.IntegrateWithEnvers方法代码示例

本文整理汇总了C#中NHibernate.Cfg.Configuration.IntegrateWithEnvers方法的典型用法代码示例。如果您正苦于以下问题:C# Configuration.IntegrateWithEnvers方法的具体用法?C# Configuration.IntegrateWithEnvers怎么用?C# Configuration.IntegrateWithEnvers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NHibernate.Cfg.Configuration的用法示例。


在下文中一共展示了Configuration.IntegrateWithEnvers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Config

 public void Config(IPersistenceUnitCfg puCfg, Configuration nhCfg)
 {
     //var enversConf = new NHibernate.Envers.Configuration.Fluent.FluentConfiguration();
     //enversConf.SetRevisionEntity<CustomRevEntity>(e => e.Id, e => e.Timestamp, typeof(CustomRevInfoListener));
     //enversConf.Audit(GetDomainEntities().Where(e => !typeof(REVINFO).IsAssignableFrom(e)));
     nhCfg.IntegrateWithEnvers(new AttributeConfiguration());
 }
开发者ID:vincentzh,项目名称:NHibernateAuditLogExample,代码行数:7,代码来源:CustomBurrowConfigurator.cs

示例2: PostProcessConfiguration

        /// <summary>
        /// 
        /// </summary>
        /// <param name="config"></param>
        protected override void PostProcessConfiguration(Configuration config)
        {
            if (FluentNhibernateMappingAssemblies != null)
            {
                foreach (var assemblyName in FluentNhibernateMappingAssemblies)
                {
                    config.AddMappingsFromAssembly(Assembly.Load(assemblyName));
                }
            }

            config.Properties.Add("nhibernate.envers.Diversia_with_modified_flag", "true");
                //log property data for revisions
            config.IntegrateWithEnvers(new AttributeConfiguration());
            config.SetListener(ListenerType.PreInsert, new DiversiaAuditEventListener());
            config.SetListener(ListenerType.PreUpdate, new DiversiaAuditEventListener());
            config.SetListener(ListenerType.PreDelete, new DiversiaAuditEventListener());
            config.SetListener(ListenerType.PreCollectionRecreate, new DiversiaAuditEventListener());
            config.SetListener(ListenerType.PreCollectionUpdate, new DiversiaAuditEventListener());
            config.SetListener(ListenerType.PreCollectionRemove, new DiversiaAuditEventListener());
            config.Cache(c =>
            {
                c.UseMinimalPuts = true;
                c.UseQueryCache = true;
                c.Provider<SysCacheProvider>();
            });
        }
开发者ID:truller2010,项目名称:Diversia,代码行数:30,代码来源:FluentNhibernateLocalSessionFactoryObject.cs

示例3: ExportSchema

        /// <summary>
        /// Cria o Schema do Banco a partir das classes mapeadas *.hbm.xml
        /// </summary>
        public static void ExportSchema()
        {
            //cria uma nova cgf no NHibernate
            var cfg = new Configuration();
            cfg.Configure();

                cfg.IntegrateWithEnvers(new AttributeConfiguration());

            //Executando o schema export
            var schemaExport = new SchemaExport(cfg);
            schemaExport.Execute(true, true, false);
        }
开发者ID:fabianohkd,项目名称:SiGCT,代码行数:15,代码来源:NHibernateSessionManager.cs

示例4: BuildEnversConfiguration

        private static void BuildEnversConfiguration(Configuration configuration)
        {
            var enversConf = new NHibernate.Envers.Configuration.Fluent.FluentConfiguration();

            IEnumerable<Type> entities = typeof(BaseEntity).Assembly.GetTypes()
                .Where(x => x.IsSubclassOf(typeof(BaseEntity)) && x.IsAbstract == false)
                .ToList();

            enversConf.Audit(entities);

            configuration.IntegrateWithEnvers(enversConf);
        }
开发者ID:lordviktor,项目名称:erp-project,代码行数:12,代码来源:NhibernateSession.cs


注:本文中的NHibernate.Cfg.Configuration.IntegrateWithEnvers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。