Пример #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, UserManager <UserModel> userManager,
                              RoleManager <IdentityRole> roleManager, PhoneStoreDbContext context)
        {
            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();
            app.UseCookiePolicy();
            app.UseAuthentication();


            //Init.SeedData(userManager, roleManager, context).Wait();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Phones}/{action=Phones}/{id?}");
            });
        }
Пример #2
0
 public RegisterModel(
     UserManager <UserModel> userManager,
     SignInManager <UserModel> signInManager,
     ILogger <RegisterModel> logger,
     IEmailSender emailSender,
     PhoneStoreDbContext context)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _logger        = logger;
     _emailSender   = emailSender;
     _context       = context;
 }
Пример #3
0
 public UnitOfWork()
 {
     context = new PhoneStoreDbContext();
 }
Пример #4
0
 public UserService(PhoneStoreDbContext context, UserManager <UserModel> manager, IHttpContextAccessor httpContextAccessor)
 {
     this.context             = context;
     this.manager             = manager;
     this.httpContextAccessor = httpContextAccessor;
 }
 public OrderRepository(PhoneStoreDbContext dbContext) : base(dbContext)
 {
 }
Пример #6
0
 public ProductRepository(PhoneStoreDbContext dbContext) : base(dbContext)
 {
 }
Пример #7
0
 public CategoryRepository(PhoneStoreDbContext dbContext) : base(dbContext)
 {
 }
Пример #8
0
 public RepositoryBase(PhoneStoreDbContext context)
 {
     this.context = context;
     DbSetEntity  = this.context.Set <TEntity>();
 }
Пример #9
0
 public DiscountRepository(PhoneStoreDbContext dbContext) : base(dbContext)
 {
 }