Пример #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, AppDBcontext db)
        {
            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();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();
            db.Database.EnsureCreated();
            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });
        }
Пример #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AppDBcontext db, IServiceProvider service)
        {
            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();
            }

            db.Database.EnsureCreated();
            SeedData.Initialize(app.ApplicationServices.GetRequiredService <IServiceScopeFactory>().CreateScope().ServiceProvider);
            SeedData.CreateUserRoles(service).Wait();

            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

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

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });
        }
Пример #3
0
 public AccountController(UserManager <AppUser> userManager,
                          SignInManager <AppUser> signInManager, RoleManager <IdentityRole> role,
                          AppDBcontext context)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _role          = role;
     _context       = context;
 }
Пример #4
0
 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
 public void Configure(IApplicationBuilder app, IHostingEnvironment env)
 {
     app.UseDeveloperExceptionPage();
     app.UseStatusCodePages();
     app.UseStaticFiles();
     app.UseAuthentication(); //login things
     app.UseMvc(routes =>
     {
         routes.MapRoute(
             name: "default",
             template: "{controller=Account}/{action=Login}/{id?}");
     });
     AppDBcontext.CreateAdminAccount(app.ApplicationServices, _configuration).Wait(); //admin role things
     //AppDBcontext.seedData(app.ApplicationServices);
 }
Пример #5
0
        public AddTable(AppDBcontext dbContext, ICheckInput check)

        {
            _Check       = check;
            this.Context = dbContext;
        }
Пример #6
0
 public ShowRepository(AppDBcontext dBcontext)
 {
     Context = dBcontext;
 }
Пример #7
0
 public AddValueToDB(AppDBcontext dbContext, ICheckValue check)
 {
     Context = dbContext;
     _check  = check;
 }
Пример #8
0
        //private GenericRepository<User> _userRepository;
        //private GenericRepository<Product> _productRepository;
        //private GenericRepository<Token> _tokenRepository;
        #endregion

        public UnitOfWork(AppDBcontext context)
        {
            _context = context;
        }
Пример #9
0
 public RepositoryWrapper(AppDBcontext appDBcontext)
 {
     AppDBcontext = appDBcontext;
 }
Пример #10
0
 public AnswerController(AppDBcontext context)
 {
     _context = context;
 }
Пример #11
0
 public CheckValueInput(AppDBcontext dbContext)
 {
     Context = dbContext;
 }
Пример #12
0
 public SQLProductRepo(AppDBcontext db, IHostingEnvironment hostingEnvironment)
 {
     this.db = db;
     this.hostingEnvironment = hostingEnvironment;
 }
Пример #13
0
 public SQLOrderRepo(AppDBcontext db)
 {
     this.db = db;
 }
Пример #14
0
 public QuestionController(AppDBcontext context)
 {
     _context = context;
 }