// Injection is handled for us; setup in startup.cs (: public GenericTrackedApiController(IMapper mapper, CoffeeAndCodeDbContext context) : base(mapper, context) { }
public UsersController(IMapper mapper, CoffeeAndCodeDbContext context) : base(mapper, context) { }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, CoffeeAndCodeDbContext context) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseMvc(routes => { routes.MapRoute("default", "{controller=Home}/{action=Index}/{id?}"); }); // Enable middleware to serve generated Swagger as a JSON endpoint app.UseSwagger(); // Enable middleware to serve swagger-ui assets (HTML, JS, CSS etc.) app.UseSwaggerUi(); // Create/Seed DB if it doesn't exist, or is empty DbInitializer.Initialize(context); }
// Injection is handled for us; setup in startup.cs (: public GenericApiController(IMapper mapper, CoffeeAndCodeDbContext context) { Mapper = mapper; Context = context; }