本文整理匯總了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);
}