Пример #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.UseDeveloperExceptionPage();
            }
            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();
            }
            CFFDataContext.CreateAdminUser(app.ApplicationServices).Wait();
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();
            app.UseAuthentication();
            app.UseAuthorization();
            app.UseSession();
            app.UseEndpoints(endpoints =>
            {
                // route for Admin area
                endpoints.MapAreaControllerRoute(
                    name: "admin",
                    areaName: "Admin",
                    pattern: "Admin/{controller=Home}/{action=Index}/{id?}");

                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });
        }
Пример #2
0
 public AccountController(UserManager <User> userMngr,
                          SignInManager <User> signInMngr, CFFDataContext context)
 {
     userManager   = userMngr;
     signInManager = signInMngr;
     _context      = context;
 }
 public OrderItemsController(CFFDataContext context)
 {
     _context = context;
 }
Пример #4
0
 public SupplyRequestsController(CFFDataContext context)
 {
     _context = context;
 }
Пример #5
0
 public ClientsController(CFFDataContext context)
 {
     _context = context;
 }
 public TaskManagementsController(CFFDataContext context)
 {
     _context = context;
 }
Пример #7
0
 public OwnersController(CFFDataContext context)
 {
     _context = context;
 }