// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.Configure <CookiePolicyOptions>(options => { // This lambda determines whether user consent for non-essential cookies is needed for a given request. options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); services.ConfigureSwaggerGen(options => { options.CustomSchemaIds(x => x.FullName); }); services.AddSingleton(provider => Configuration); Infra.Startup.ConfigureServices(services, Configuration); var configurationProvider = new ApiProvider(); Configuration.Bind("ApiProvider", configurationProvider); services.AddSingleton(configurationProvider); SwaggerConfig.AddSwaggerDoc(services); services.AddCors(options => { options.AddPolicy("CorsPolicy", builder => builder.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader() .WithExposedHeaders("Set-Authorization") .AllowCredentials()); }); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); PrepareAutoFac(services); }