Пример #1
0
 public OrderService(IUserService accountService, ShopAppDbContext dbContext, IProductService productService, IRepository <ProductViewModel, ProductBaseInputModel> productRepository)
 {
     this.userService       = accountService;
     this.dbContext         = dbContext;
     this.productService    = productService;
     this.productRepository = productRepository;
 }
Пример #2
0
        // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
        public void ConfigureAuth(IAppBuilder app)
        {
            // Configure the db context, user manager and signin manager to use a single instance per request
            app.CreatePerOwinContext <ShopAppDbContext>(() => ShopAppDbContext.Create());
            app.CreatePerOwinContext <ShopUserManager>(ShopUserManager.Create);
            app.CreatePerOwinContext <ShopSignInManager>(ShopSignInManager.Create);
            app.CreatePerOwinContext <ShopRoleManager>(ShopRoleManager.Create);

            // Enable the application to use a cookie to store information for the signed in user
            // and to use a cookie to temporarily store information about a user logging in with a third party login provider
            // Configure the sign in cookie
            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath          = new PathString("/Account/Login")
            });
            app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);

            // Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process.
            // TODO [GM]: Two factor authentication
            app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5));

            // Enables the application to remember the second login verification factor such as phone or email.
            // Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from.
            // This is similar to the RememberMe option when you log in.
            app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);
        }
 public AccountService(ShopAppDbContext dbContext, UserManager <ShopUser> userManager,
                       SignInManager <ShopUser> signInManager, IRoleService roleService)
 {
     this._dbContext     = dbContext;
     this._userManager   = userManager;
     this._signInManager = signInManager;
     this._roleService   = roleService;
 }
Пример #4
0
 public UserService(ShopAppDbContext dbContext) : base(dbContext)
 {
 }
 public CategoryService(ShopAppDbContext dbContext,
                        IRepository <CategoryViewModel, CategoryBaseInputModel> categoryRepository) : base(dbContext)
 {
     this._categoryRepository = categoryRepository;
 }
Пример #6
0
 public RoleService(ShopAppDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
 public AdminController(ShopAppDbContext ctx)
 {
     _ctx = ctx;
 }
 public DeleteProduct(ShopAppDbContext context)
 {
     _context = context;
 }
 public UpdateProduct(ShopAppDbContext context)
 {
     _context = context;
 }
Пример #10
0
 public ProductRepository(ShopAppDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Пример #11
0
 public UserService(ShopAppDbContext dbContext, IRoleService roleService)
 {
     this.dbContext   = dbContext;
     this.roleService = roleService;
 }
Пример #12
0
 public ProductService(ShopAppDbContext dbContext) : base(dbContext)
 {
 }
Пример #13
0
 protected BaseService(ShopAppDbContext dbContext)
 {
     _dbContext = dbContext;
 }
 public AccountService(ShopAppDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Пример #15
0
 public CategoryService(ShopAppDbContext dbContext, IRepository <CategoryViewModel, CategoryInputModel> categoryRepository)
 {
     this.dbContext          = dbContext;
     this.categoryRepository = categoryRepository;
 }
 public CategoryRepository(ShopAppDbContext dbContext, IUserService userService)
 {
     this.dbContext   = dbContext;
     this.userService = userService;
 }
 public static ShopRoleManager Create()
 {
     return(new ShopRoleManager(new RoleStore <IdentityRole>(ShopAppDbContext.Create())));
 }
 public ProductRepository(ShopAppDbContext dbContext, IRepository <CategoryViewModel, CategoryBaseInputModel> categoryRepository)
 {
     _dbContext          = dbContext;
     _categoryRepository = categoryRepository;
 }
Пример #19
0
 public UserDao()
 {
     db = new ShopAppDbContext();
 }
Пример #20
0
 public GetProduct(ShopAppDbContext ctx)
 {
     _ctx = ctx;
 }
Пример #21
0
 public ProductService(ICategoryService categoryService, ShopAppDbContext dbContext, IRepository <ProductViewModel, ProductBaseInputModel> productRepository)
 {
     this.categoryService   = categoryService;
     this.dbContext         = dbContext;
     this.productRepository = productRepository;
 }