示例#1
0
        public AuditEventBusDatabaseListener(AuditEventBus auditEventBus, IPersistenceConfigurer configurer)
        {
            database  = new FluentNHibernateDatabase(configurer);
            databases = new Dictionary <IPersistenceConfigurer, FluentNHibernateDatabase> {
                { configurer, database }
            };

            auditEventBus.EventPosted += (sender, auditEvent) => database.Add(auditEvent);
        }
示例#2
0
 public void SetDatabase(IPersistenceConfigurer configurer)
 {
     if (databases.TryGetValue(configurer, out database))
     {
         return;
     }
     database = new FluentNHibernateDatabase(configurer);
     databases.Add(configurer, database);
 }