Пример #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;
 }