static ISessionFactory CreateSessionFactory() { var provider = new NHibernateSessionFactoryProvider(new[] { typeof(TimeoutSagaMap), }); return(provider.GetSessionFactory()); }
static ISessionFactory CreateSessionFactory() { var provider = new NHibernateSessionFactoryProvider(new[] { typeof(HealthSagaMap), }); return provider.GetSessionFactory(); }
static ISessionFactory CreateSessionFactory() { var provider = new NHibernateSessionFactoryProvider(new Type[] { typeof(SubscriptionSagaMap), typeof(SubscriptionClientSagaMap), }); return(provider.GetSessionFactory()); }
static ISessionFactory CreateSessionFactory() { var provider = new NHibernateSessionFactoryProvider(new Type[] { typeof(SubscriptionSagaMap), typeof(SubscriptionClientSagaMap), }); return provider.GetSessionFactory(); }
protected override void EstablishContext() { base.EstablishContext(); var provider = new NHibernateSessionFactoryProvider(new Type[] { typeof(ConcurrentSagaMap), typeof(ConcurrentLegacySagaMap) }); var sessionFactory = provider.GetSessionFactory(); _openConnection = new SQLiteConnection(provider.Configuration.Properties[NHibernate.Cfg.Environment.ConnectionString]); _openConnection.Open(); sessionFactory.OpenSession(_openConnection); SessionFactory = new SingleConnectionSessionFactory(sessionFactory, _openConnection); BuildSchema(provider.Configuration, _openConnection); }
protected override void EstablishContext() { base.EstablishContext(); var provider = new NHibernateSessionFactoryProvider(new Type[] { typeof(ConcurrentSagaMap), typeof(ConcurrentLegacySagaMap) }); var sessionFactory = provider.GetSessionFactory(); _openConnection = new SQLiteConnection(provider.Configuration.Properties[NHibernate.Cfg.Environment.ConnectionString]); _openConnection.Open(); sessionFactory.OpenSession(_openConnection); SessionFactory = new SingleConnectionSessionFactory(sessionFactory, _openConnection); BuildSchema(provider.Configuration, _openConnection); }
protected override void EstablishContext() { var provider = new NHibernateSessionFactoryProvider(new[] { typeof(ConcurrentSagaMap), typeof(ConcurrentLegacySagaMap) }, x => { x.Dialect<MsSql2008Dialect>(); x.BatchSize = 100; x.ConnectionString = "Server=(local);initial catalog=test;Trusted_Connection=yes"; x.LogSqlInConsole = true; x.LogFormattedSql = true; x.IsolationLevel = IsolationLevel.RepeatableRead; // .DefaultSchema("dbo") }); SessionFactory = provider.GetSessionFactory(); base.EstablishContext(); }
protected override void EstablishContext() { var provider = new NHibernateSessionFactoryProvider(new[] { typeof(ConcurrentSagaMap), typeof(ConcurrentLegacySagaMap) }, x => { x.Dialect <MsSql2008Dialect>(); x.BatchSize = 100; x.ConnectionString = "Server=(local);initial catalog=test;Trusted_Connection=yes"; x.LogSqlInConsole = true; x.LogFormattedSql = true; x.IsolationLevel = IsolationLevel.RepeatableRead; // .DefaultSchema("dbo") }); SessionFactory = provider.GetSessionFactory(); base.EstablishContext(); }
public void Setup() { var provider = new NHibernateSessionFactoryProvider(new[] { typeof(ConcurrentSagaMap), typeof(ConcurrentLegacySagaMap) }); ISessionFactory sessionFactory = provider.GetSessionFactory(); _openConnection = new SQLiteConnection(provider.Configuration.Properties[NHibernate.Cfg.Environment.ConnectionString]); _openConnection.Open(); sessionFactory.OpenSession(_openConnection); _sessionFactory = new SingleConnectionSessionFactory(sessionFactory, _openConnection); BuildSchema(provider.Configuration, _openConnection); _sagaId = NewId.NextGuid(); }
public void Setup() { var provider = new NHibernateSessionFactoryProvider(new[] { typeof(ConcurrentSagaMap), typeof(ConcurrentLegacySagaMap) }); ISessionFactory sessionFactory = provider.GetSessionFactory(); _openConnection = new SQLiteConnection(provider.Configuration.Properties[NHibernate.Cfg.Environment.ConnectionString]); _openConnection.Open(); sessionFactory.OpenSession(_openConnection); _sessionFactory = new SingleConnectionSessionFactory(sessionFactory, _openConnection); BuildSchema(provider.Configuration, _openConnection); _sagaId = NewId.NextGuid(); }
public void ConfigureServices(IServiceCollection services) { var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json"); Configuration = builder.Build(); AppSettings.ConnectionString = $"{Configuration["connectionString"]}"; services.AddMvc(); services.AddCors(); services.Configure <IISOptions>(o => { o.ForwardClientCertificate = false; }); services.AddResponseCompression(); services.AddSingleton <ISessionFactory>((x) => NHibernateSessionFactoryProvider.CreateSessionFactory()); services.AddScoped <IUow, Uow>(); services.AddScoped <ISession>((x) => x.GetRequiredService <IUow>().OpenSession()); services.AddTransient <IContractRepository, ContractRepository>(); services.AddTransient <IAccountRepository, AccountRepository>(); services.AddTransient <ICallTypeRepository, CallTypeRepository>(); services.AddTransient <ICallRepository, CallRepository>(); services.AddTransient <ICallGroupRepository, CallGroupRepository>(); services.AddTransient <IAccountRepository, AccountRepository>(); services.AddTransient <ISectorRepository, SectorRepository>(); services.AddTransient <ContractHandler, ContractHandler>(); services.AddTransient <AccountHandler, AccountHandler>(); services.AddTransient <CallTypeHandler, CallTypeHandler>(); services.AddTransient <CallGroupHandler, CallGroupHandler>(); services.AddTransient <CallHandler, CallHandler>(); services.AddTransient <AccountHandler, AccountHandler>(); services.AddTransient <SectorHandler, SectorHandler>(); }