コード例 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseSession();
                app.UseStatusCodePages();
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            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();
            }

            using (var scope = app.ApplicationServices.CreateScope())
            {
                appDBcontent content = scope.ServiceProvider.GetRequiredService <appDBcontent>();
                DbObjects.Initial(content);
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseSession();
            app.UseRouting();

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

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

                endpoints.MapRazorPages();
                endpoints.MapHub <ChatHub>("/chat");
            });
        }
コード例 #2
0
 public CarRepository(appDBcontent appDBContent)
 {
     this.appDbContent = appDBContent;
 }
コード例 #3
0
 public HomeController(appDBcontent context, UserManager <UserModel> userManager, IAllMilks milkRep)
 {
     _milkRep     = milkRep;
     db           = context;
     _userManager = userManager;
 }
コード例 #4
0
 public Ordersrepository(appDBcontent appDBcontent, ShopCart shopCart)
 {
     this.appDBcontent = appDBcontent;
     this.shopCart     = shopCart;
 }
コード例 #5
0
 public MilkController(IAllMilks iallMilks, IMilkCategory imilkCategory, appDBcontent context)
 {
     db             = context;
     _allMilks      = iallMilks;
     _allCategories = imilkCategory;
 }
コード例 #6
0
ファイル: ShopCart.cs プロジェクト: LilBigStone/AspNetCore
 public ShopCart(appDBcontent appDBContent)
 {
     this.appDbContent = appDBContent;
 }