コード例 #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ISqlDataAccess sql        = new SqlDataAccess();
            IMainView      mainView   = new MainForm();
            IPersonData    personData = new PersonData(sql);
            IComboBoxData  boxData    = new ComboBoxData(sql);

            ApplicationSeed.Seed(boxData, sql);

            var mainPresenter = new MainPresenter(mainView, personData, boxData);

            mainPresenter.ShowView();
        }
コード例 #2
0
        public static void Main(string[] args)
        {
            var host = CreateHostBuilder(args).Build();

            using (var scope = host.Services.CreateScope())
            {
                var serviceProvider = scope.ServiceProvider;
                try
                {
                    var db = serviceProvider.GetRequiredService <ApplicationDbContext>();

                    var userManager = serviceProvider.
                                      GetRequiredService <UserManager <Registrar> >();

                    ApplicationSeed.Seed
                        (userManager, db, false);
                }
                catch
                {
                }
            }
            host.Run();
        }
コード例 #3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, UserManager <Registrar> userManager, ApplicationDbContext db)
        {
            app.UseResponseCompression();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseMigrationsEndPoint();
                app.UseWebAssemblyDebugging();
            }
            else
            {
                app.UseExceptionHandler("/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.UseBlazorFrameworkFiles();
            app.UseStaticFiles();

            app.UseRouting();

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

            ApplicationSeed.Seed(userManager, db, false);

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapRazorPages();
                endpoints.MapControllers();
                endpoints.MapHub <VisitorHub>("/visitorhub");
                endpoints.MapFallbackToFile("index.html");
            });
        }