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(PadawanNHibernateHelper.SessionFactory()); services.AddTransient <IUow, Uow>(); services.AddTransient <IAccountRepository, AccountRepository>(); services.AddTransient <AccountHandler, AccountHandler>(); }
public void ConfigureServices(IServiceCollection services) { AppSettings.ConnectionString = $"{Configuration["connectionString"]}"; services.AddMvc(); services.AddCors(); services.Configure <IISOptions>(o => { o.ForwardClientCertificate = false; }); services.AddResponseCompression(); services.AddSingleton(PadawanNHibernateHelper.SessionFactory()); services.AddScoped <IUow, Uow>(); services.AddTransient <IAccountRepository, AccountRepository>(); services.AddTransient <AccountHandler, AccountHandler>(); }
public Uow() { _session = PadawanNHibernateHelper.OpenSession(); }