public void ConfigureServices(IServiceCollection services) { services.Configure <KestrelServerOptions>(options => { options.AllowSynchronousIO = true; }); services.Configure <IISServerOptions>(options => { options.AllowSynchronousIO = true; }); services.AddAuthorization(); services.AddAuthentication("Bearer") .AddIdentityServerAuthentication(options => { options.Authority = Configuration["IdentityServerEndpoints:Authority"]; options.RequireHttpsMetadata = true; options.ApiName = "merp.accountancy.api"; }); services.RegisterClientsCors(Configuration); services.AddHttpContextAccessor(); services.AddMvc(option => option.EnableEndpointRouting = false); services.AddSingleton(services); var bootstrapper = new AppBootstrapper(Configuration, services); bootstrapper.Configure(); services.AddScoped <JobOrderControllerWorkerServices>(); services.AddScoped <InvoiceControllerWorkerServices>(); services.AddScoped <DraftControllerWorkerServices>(); }
public void ConfigureServices(IServiceCollection services) { services.AddAuthorization(); services.AddAuthentication("Bearer") .AddIdentityServerAuthentication(options => { options.Authority = Configuration["IdentityServerEndpoints:Authority"]; options.RequireHttpsMetadata = true; options.ApiName = "merp.accountancy.api"; }); RegisterClientsCors(services); services.AddHttpContextAccessor(); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddSingleton(services); var bootstrapper = new AppBootstrapper(Configuration, services); bootstrapper.Configure(); }