// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, EventosApiContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } app.UseCors("CorsPolicy"); app.UseHttpsRedirection(); app.UseStaticFiles(); DbSeeder.SeedDb(context); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller}/{action=Index}/{id?}"); }); }
public SalasController(EventosApiContext context, IDataRepository <Sala> repo) { _context = context; _repo = repo; }