public Configuration Create() { var cfg = new Configuration(); var provider = _providerAccessor.EnabledDbProvider; provider.SetupConfiguration(cfg); cfg.SetInterceptor(_interceptor); var connStr = _shellSettings["ConnectionString"]; if (string.IsNullOrEmpty(connStr)) { throw new InvalidOperationException($"Must set the connection string for tenant '{_shellSettings.Name}'"); } cfg.SetConnectionString(connStr); cfg.SetProperty("hbm2ddl.keywords", "auto-quote"); this.Logger.LogDebug("Loading NHibernate mapping..."); _mapper.MapAllEntities(cfg); this.Logger.LogDebug("NHibernate mapping loaded."); return(cfg); }