public AdminService(UserManager <IdentityUser> userManager, AdminPanelDbContext context, IEmailService emailService) { this.userManager = userManager; this.context = context; this.emailService = emailService; }
public EmailService(UserManager <IdentityUser> userManager, AdminPanelDbContext context, IConfiguration configuration) { this.userManager = userManager; this.context = context; this.configuration = configuration; }
public ProductService(AdminPanelDbContext context) { this.context = context; }
public RequisitionService(AdminPanelDbContext context) { this.context = context; }
public ApprovalService(AdminPanelDbContext context, IAdminService adminService) { this.context = context; this.adminService = adminService; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider services, AdminPanelDbContext dataContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); app.UseAuthentication(); dataContext.Database.Migrate(); CreateUserRoles(services).Wait(); SetupDatabase(services).Wait(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); routes.MapRoute( name: "api", template: "api/{controller=Values}/{action=Get}"); }); }