本文整理汇总了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());
}
示例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>();
});
}
示例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);
}
示例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);
}