コード例 #1
0
 public AdminService(UserManager <IdentityUser> userManager,
                     AdminPanelDbContext context,
                     IEmailService emailService)
 {
     this.userManager  = userManager;
     this.context      = context;
     this.emailService = emailService;
 }
コード例 #2
0
 public EmailService(UserManager <IdentityUser> userManager,
                     AdminPanelDbContext context,
                     IConfiguration configuration)
 {
     this.userManager   = userManager;
     this.context       = context;
     this.configuration = configuration;
 }
コード例 #3
0
 public ProductService(AdminPanelDbContext context)
 {
     this.context = context;
 }
コード例 #4
0
 public RequisitionService(AdminPanelDbContext context)
 {
     this.context = context;
 }
コード例 #5
0
 public ApprovalService(AdminPanelDbContext context, IAdminService adminService)
 {
     this.context      = context;
     this.adminService = adminService;
 }
コード例 #6
0
        // 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}");
            });
        }