protected IServiceCollection GetCollection() { IServiceCollection service = new ServiceCollection(); AppBootstraper.InitServices(service); //service.AddLogging(); service.AddMediatR(Assembly.GetExecutingAssembly()); return(service); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.ConfigureSwagger(); services.ConfigureAuthentication(Configuration); services.AddControllers(); services.AddTransient <ITokenGenerator, JWTTokenGenerator>(); services.AddHangfire(x => x.UseSqlServerStorage(Configuration.GetConnectionString("SmartaceDb"))); services.AddHangfireServer(); services.AddControllers(); services.AddDbContext <SmartaceContext>(options => options.UseSqlServer(Configuration.GetConnectionString("SmartaceDb"), b => b.MigrationsAssembly("Smartace.Core"))); AppBootstraper.InitServices(services); }
private static void BootstrapApp(string connectionString) { var appBootstraper = new AppBootstraper(new MsSqlConnectionFactory(connectionString)); appBootstraper.Bootstrap(); }