Ejemplo n.º 1
0
 public AdminController(UserManager <AppUser> userManager, IUserValidator <AppUser> userValidator, IPasswordValidator <AppUser> passValidator, IPasswordHasher <AppUser> passwordHasher, AppSurveyDbContext context, File file)
 {
     _userManager       = userManager;
     _userValidator     = userValidator;
     _passwordValidator = passValidator;
     _passwordHasher    = passwordHasher;
     _context           = context;
     _file = file;
 }
Ejemplo n.º 2
0
        // 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, AppSurveyDbContext context)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();
            app.UseIdentity();
            app.UseSession();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
            AppSurveyIdDbContext.CreateAdminAccount(app.ApplicationServices, Configuration).Wait();
            //AppSurveyIdDbInitializer.Initialize(app);
            AppSurveyDbInitializer.Initialize(context);
        }