예제 #1
0
 public AppController(IMailService mailService, IWARepository repository,
                      IMapper mapper, WAContext context, IHostingEnvironment app,
                      UserManager <StoreUser> userManager)
 {
     _mailService = mailService;
     _repository  = repository;
     _context     = context;
     _mapper      = mapper;
     _app         = app;
     _userManager = userManager;
 }
예제 #2
0
 public AccountController(ILogger <AccountController> logger,
                          SignInManager <StoreUser> signInManager,
                          UserManager <StoreUser> userManager,
                          IConfiguration config,
                          WAContext context,
                          RoleManager <IdentityRole> roleManager)
 {
     _logger        = logger;
     _signInManager = signInManager;
     _userManager   = userManager;
     _config        = config;
     _context       = context;
     _roleManager   = roleManager;
 }
예제 #3
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,
                              WAContext waContext)
        {
            loggerFactory.AddConsole();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                loggerFactory.AddDebug(LogLevel.Information);
            }
            else
            {
                loggerFactory.AddDebug(LogLevel.Error);
                app.UseExceptionHandler("/Home/Error");
            }

            var options = new RewriteOptions()
                          .AddRedirectToHttps();

            app.UseRewriter(options);

            if (env.IsDevelopment())
            {
                app.UseCors("CorsPolicy");
            }

            app.UseAuthentication();

            app.UseMvc(config =>
            {
                config.MapRoute(
                    name: "Default",
                    template: "{controller}/{action}/{id?}",
                    defaults: new { controller = "Home", action = "Index" }
                    );
            });

            waContext.Database.Migrate();
            waContext.EnsureSeedDataForContext();
        }
예제 #4
0
 public WARepository(WAContext context,
                     UserManager <WAUser> userManager)
 {
     this.context     = context;
     this.userManager = userManager;
 }