// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IAnimalsDbService service) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMiddleware <MyMiddleware>(); // wersja na szybko, a u góry jak to zrobić w osobnej klasie // app.Use(async (context, next) => // { // context.Response.Headers.Add("IndexNumber","s19191"); // await next(); // }); app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public AnimalsController(IAnimalsDbService dbService) { this._dbService = dbService; }
public AnimalsController(IAnimalsDbService service) { _service = service; }
public AnimalsController(IConfiguration configuration, IAnimalsDbService service) { Configuration = configuration; _service = service; }