Esempio n. 1
0
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddControllers(options => options.Filters.Add(typeof(ExceptionFilter)));
     ServicesFactory.AddDbContextServices(services, this.Configuration.GetConnectionString("BookedUYDB"));
     ServicesFactory.AddMyServices(services);
     services.AddScoped <AuthorizationFilter>();
     services.AddCors(
         options =>
     {
         options.AddPolicy(
             "CorsPolicy",
             builder => builder
             .AllowAnyOrigin()
             .AllowAnyMethod()
             .AllowAnyHeader()
             );
     }
         );
     services.AddHttpsRedirection(options =>
     {
         options.RedirectStatusCode = StatusCodes.Status307TemporaryRedirect;
         options.HttpsPort          = 5001;
     });
 }