public IndexModel(InMemoryStorageContext memContext, SignInManager <PcrIdentityUser> signInManager,
                   UserManager <PcrIdentityUser> userManager)
 {
     _context       = memContext;
     _signInManager = signInManager;
     _userManager   = userManager;
 }
Esempio n. 2
0
 public CombosModel(InMemoryStorageContext context, SignInManager <PcrIdentityUser> signInManager,
                    UserManager <PcrIdentityUser> userManager)
 {
     _context       = context;
     _signInManager = signInManager;
     _userManager   = userManager;
 }
 public ImportModel(InMemoryStorageContext context, SignInManager <PcrIdentityUser> signInManager,
                    UserManager <PcrIdentityUser> userManager, ZhouParserFactory parserFactory)
 {
     _context       = context;
     _signInManager = signInManager;
     _userManager   = userManager;
     _parserFactory = parserFactory;
 }
Esempio n. 4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, InMemoryStorageContext dataContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseMigrationsEndPoint();
            }
            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.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
                endpoints.MapRazorPages();
            });

            var supportedCultures   = new[] { "zh-CN" };
            var localizationOptions = new RequestLocalizationOptions()
                                      .SetDefaultCulture(supportedCultures[0])
                                      .AddSupportedCultures(supportedCultures)
                                      .AddSupportedUICultures(supportedCultures);

            app.UseRequestLocalization(localizationOptions);

            dataContext.DbContext.Database.Migrate();

            if (LoadIMContext)
            {
                Console.WriteLine("Loading IM context");
                var guilds = dataContext.DbContext.Guilds.ToList();

                var comboCalculator = new FindAllCombos();

                foreach (var g in guilds)
                {
                    var imGuild = dataContext.GetGuildAsync(g.GuildID).Result;
                    comboCalculator.UpdateGuildAsync(dataContext, g.GuildID, imGuild).Wait();
                    CalcComboValues.RunAllAsync(dataContext.DbContext, g, imGuild).Wait();
                }

                Console.WriteLine("IM context loaded.");
            }
        }
 public InMemoryAccountsRepository(InMemoryStorageContext context)
 {
     _db = context;
 }
Esempio n. 6
0
 public InMemoryPersonsRepository(InMemoryStorageContext context)
 {
     _db = context;
 }
 public RemoveGuildModel(InMemoryStorageContext context)
 {
     _context = context;
 }