public ProductRepository(SIMSDbContext context) { _context = 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, SIMSDbContext db) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); // loggerFactory.AddDebug(); loggerFactory.AddFile("Logs/SIMS-{Date}.txt"); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = true }); } else { app.UseExceptionHandler("/Home/Error"); } app.UseTokenMiddlewareExtensions(); app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller}/{action}/{id?}"); routes.MapRoute( name: "api", template: "api/{controller}/{action}/{id?}"); routes.MapSpaFallbackRoute( name: "spa-fallback", defaults: new { controller = "Home", action = "Index" }); }); InitDb.Init(db); }
public UsersService(IConfiguration configuration, SIMSDbContext db) { this.configuration = configuration; this.dbContext = db; }
public AccountRepository(SIMSDbContext context) { _context = context; }
public RoleRepository(SIMSDbContext context) { _context = context; }
public CategoryRepository(SIMSDbContext context) { _context = context; }