Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            DataAccessDI.ConfigureServices(services, Configuration);
            BusinessLogicDI.ConfigureServices(services, Configuration);
            CommonDI.ConfigureServices(services, Configuration);
        }
Ejemplo n.º 2
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddCors(options =>
     {
         options.AddPolicy("AllowAll",
                           builder =>
         {
             builder
             .AllowAnyOrigin()
             .AllowAnyMethod()
             .AllowAnyHeader()
             .AllowCredentials();
         });
     });
     services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
     .AddJsonOptions(
         options => options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
         );
     DataAccessDI.ConfigureServices(services, Configuration);
     BusinessLogicDI.ConfigureServices(services, Configuration);
     CommonDI.ConfigureServices(services, Configuration);
 }