예제 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(
            IApplicationBuilder app,
            IHostingEnvironment env,
            MchneContext dbContext,
            UserManager <AppUser> userManager,
            RoleManager <IdentityRole> roleManager,
            ApplicationDbContext appContext,
            IMapper mapper,
            IConfiguration config)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            DbInitializer.InitializeSuperUser(appContext, userManager, roleManager, mapper, config);

            app.UseCors("CorsPolicy");
            app.UseAuthentication();
            app.UseMvc();

            // ===== Create tables ======
            dbContext.Database.EnsureCreated();
        }
예제 #2
0
 public ChaptersController(MchneContext context)
 {
     _context = context;
 }
예제 #3
0
 public NovelsController(MchneContext context)
 {
     _context = context;
 }