Exemplo n.º 1
0
        public static UserManager<ApplicationUser> CreateUserManager(IDataProtectionProvider dataProtectionProvider, IPartsUnlimitedContext context)
        {
            var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>((DbContext)context));
            // Configure validation logic for usernames
            manager.UserValidator = new UserValidator<ApplicationUser>(manager)
            {
                AllowOnlyAlphanumericUserNames = false,
                RequireUniqueEmail = true
            };

            // Configure validation logic for passwords
            manager.PasswordValidator = new PasswordValidator
            {
                RequiredLength = 6,
                RequireNonLetterOrDigit = true,
                RequireDigit = true,
                RequireLowercase = true,
                RequireUppercase = true,
            };

            // Configure user lockout defaults
            manager.UserLockoutEnabledByDefault = true;
            manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5);
            manager.MaxFailedAccessAttemptsBeforeLockout = 5;

            // Register two factor authentication providers. This application uses Phone and Emails as a step of receiving a code for verifying the user
            // You can write your own provider and plug it in here.
            manager.RegisterTwoFactorProvider("Phone Code", new PhoneNumberTokenProvider<ApplicationUser>
            {
                MessageFormat = "Your security code is {0}"
            });
            manager.RegisterTwoFactorProvider("Email Code", new EmailTokenProvider<ApplicationUser>
            {
                Subject = "Security Code",
                BodyFormat = "Your security code is {0}"
            });
            manager.EmailService = new EmailService();
            manager.SmsService = new SmsService();

            if (dataProtectionProvider != null)
            {
                manager.UserTokenProvider = new DataProtectorTokenProvider<ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity"));
            }

            return manager;
        }
Exemplo n.º 2
0
 public StoreManagerController(IPartsUnlimitedContext context)
 {
     db = context;
 }
 public CategoryMenuComponent(IPartsUnlimitedContext context, IMemoryCache memoryCache)
 {
     _db = context;
     _cache = memoryCache;
 }
Exemplo n.º 4
0
 public CartSummaryComponent(IPartsUnlimitedContext context)
 {
     _db = context;
 }
Exemplo n.º 5
0
 public RaincheckQuery(IPartsUnlimitedContext context)
 {
     _context = context;
 }
Exemplo n.º 6
0
 public CustomerController(IPartsUnlimitedContext context)
 {
     _context = context;
 }
 public RecommendationsController(IPartsUnlimitedContext context, IRecommendationEngine recommendationEngine, IWebsiteOptions websiteOptions)
 {
     _db = context;
     _recommendation = recommendationEngine;
     _option = websiteOptions;
 }
Exemplo n.º 8
0
 public StringContainsProductSearch(IPartsUnlimitedContext context)
 {
     _context = context;
 }
        public ShoppingCartController(IPartsUnlimitedContext context, IAntiforgery antiforgery)
        {
            _db = context;

            _antiforgery = antiforgery;
        }
Exemplo n.º 10
0
 public StoreManagerController(IPartsUnlimitedContext context, IConnectionManager connectionManager, IMemoryCache memoryCache)
 {
     _db             = context;
     _annoucementHub = connectionManager.GetHubContext <AnnouncementHub>();
     _cache          = memoryCache;
 }
Exemplo n.º 11
0
 public ShoppingCartController(IPartsUnlimitedContext context, ITelemetryProvider telemetryProvider, IAntiforgery antiforgery)
 {
     _db          = context;
     _telemetry   = telemetryProvider;
     _antiforgery = antiforgery;
 }
Exemplo n.º 12
0
 public ShoppingCart(IPartsUnlimitedContext db, IProductsRepository productsRepository)
 {
     _db = db;
     this.productsRepository = productsRepository;
 }
 public CheckoutController(IPartsUnlimitedContext context, UserManager <ApplicationUser> userManager)
 {
     _userManager = userManager;
     _db          = context;
 }
Exemplo n.º 14
0
 public ShoppingCartController(IPartsUnlimitedContext context, ITelemetryProvider telemetryProvider)
 {
     db        = context;
     telemetry = telemetryProvider;
 }
Exemplo n.º 15
0
 public RecommendationsController(IPartsUnlimitedContext context, IRecommendationEngine recommendationEngine)
 {
     db             = context;
     recommendation = recommendationEngine;
 }
Exemplo n.º 16
0
 public OrdersQuery(IPartsUnlimitedContext context, IProductsRepository productsRepository)
 {
     _db = context;
     this.productsRepository = productsRepository;
 }
 public StringContainsProductSearch(IPartsUnlimitedContext context)
 {
     _context = context;
 }
 public CheckoutController(IPartsUnlimitedContext context, UserManager <ApplicationUser> userManager, IConfiguration configuration)
 {
     _userManager  = userManager;
     _db           = context;
     Configuration = configuration;
 }
 public ShoppingCartController(IPartsUnlimitedContext context, ITelemetryProvider telemetryProvider)
 {
     _db = context;
     _telemetry = telemetryProvider;
 }
Exemplo n.º 20
0
 public RecommendationsController(IPartsUnlimitedContext context, IRecommendationEngine recommendationEngine)
 {
     db = context;
     recommendation = recommendationEngine;
 }
Exemplo n.º 21
0
 public ShoppingCart(IPartsUnlimitedContext db)
 {
     _db = db;
 }
Exemplo n.º 22
0
 public HomeController(IPartsUnlimitedContext context)
 {
     _db = context;
 }
Exemplo n.º 23
0
 public ProductsController(IPartsUnlimitedContext context)
 {
     _context = context;
 }
 public CategoryMenuComponent(IPartsUnlimitedContext context, IMemoryCache memoryCache)
 {
     _db    = context;
     _cache = memoryCache;
 }
Exemplo n.º 25
0
 public RaincheckQuery(IPartsUnlimitedContext context, IProductsRepository productsRepository)
 {
     _context = context;
     this.productsRepository = productsRepository;
 }
Exemplo n.º 26
0
 public RaincheckQuery(IPartsUnlimitedContext context)
 {
     _context = context;
 }
 public ProductsController(IPartsUnlimitedContext context)
 {
     _context = context;
 }
 public AnnouncementComponent(IPartsUnlimitedContext context, IMemoryCache memoryCache)
 {
     _db    = context;
     _cache = memoryCache;
 }
Exemplo n.º 29
0
 public CustomerController(IPartsUnlimitedContext context)
 {
     _context = context;
 }
Exemplo n.º 30
0
 public CheckoutController(IPartsUnlimitedContext context)
 {
     db = context;
 }
Exemplo n.º 31
0
 public HomeController(IPartsUnlimitedContext context)
 {
     _db = context;
 }
Exemplo n.º 32
0
 public ShoppingCart(IPartsUnlimitedContext db)
 {
     _db = db;
 }
 public HomeController(IPartsUnlimitedContext context, IMemoryCache memoryCache)
 {
     _db    = context;
     _cache = memoryCache;
 }
Exemplo n.º 34
0
 public StoreManagerController(IPartsUnlimitedContext context, IMemoryCache memoryCache)
 {
     _db    = context;
     _cache = memoryCache;
 }
Exemplo n.º 35
0
 public CheckoutController(IPartsUnlimitedContext context, UserManager<ApplicationUser> userManager)
 {
     _userManager = userManager;
     _db = context;
 }
Exemplo n.º 36
0
 public RecommendationsController(IPartsUnlimitedContext context, IRecommendationEngine recommendationEngine, IWebsiteOptions websiteOptions)
 {
     _db             = context;
     _recommendation = recommendationEngine;
     _option         = websiteOptions;
 }
 public ShoppingCartController(IPartsUnlimitedContext context, ITelemetryProvider telemetryProvider, IAntiforgery antiforgery)
 {
     _db = context;
     _telemetry = telemetryProvider;
     _antiforgery = antiforgery;
 }
Exemplo n.º 38
0
 public StoreController(IPartsUnlimitedContext context, IMemoryCache memoryCache, IProductsRepository productsRepository)
 {
     _db    = context;
     _cache = memoryCache;
     this.productsRepository = productsRepository;
 }
 public CartSummaryComponent(IPartsUnlimitedContext context)
 {
     _db = context;
 }
Exemplo n.º 40
0
 public OrdersQuery(IPartsUnlimitedContext context)
 {
     _db = context;
 }
 public AnnouncementComponent(IPartsUnlimitedContext context, IMemoryCache memoryCache)
 {
     _db = context;
     _cache = memoryCache;
 }
Exemplo n.º 42
0
 public CheckoutController(IPartsUnlimitedContext context, IProductsRepository productsRepository)
 {
     _db = context;
     this.productsRepository = productsRepository;
 }
Exemplo n.º 43
0
 public static ShoppingCart GetCart(IPartsUnlimitedContext db, HttpContextBase context)
 {
     var cart = new ShoppingCart(db);
     cart.ShoppingCartId = cart.GetCartId(context);
     return cart;
 }
 public StoreManagerController(IPartsUnlimitedContext context, ConnectionManager connectionManager, IMemoryCache memoryCache)
 {
     _db = context;
     _cache = memoryCache;
 }
 public StoreManagerController(IPartsUnlimitedContext context, IConnectionManager connectionManager, IMemoryCache memoryCache)
 {
     _db = context;
     _annoucementHub = connectionManager.GetHubContext<AnnouncementHub>();
     _cache = memoryCache;
 }
Exemplo n.º 46
0
 public OrdersQuery(IPartsUnlimitedContext context)
 {
     _db = context;
 }
Exemplo n.º 47
0
 public CheckoutController(IPartsUnlimitedContext context)
 {
     _db = context;
 }
Exemplo n.º 48
0
 public StoreController(IPartsUnlimitedContext context)
 {
     db = context;
 }
Exemplo n.º 49
0
 public StoreController(IPartsUnlimitedContext context, IMemoryCache memoryCache)
 {
     _db = context;
     _cache = memoryCache;
 }
Exemplo n.º 50
0
        public static UserManager <ApplicationUser> CreateUserManager(IDataProtectionProvider dataProtectionProvider, IPartsUnlimitedContext context)
        {
            var manager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>((DbContext)context));

            // Configure validation logic for usernames
            manager.UserValidator = new UserValidator <ApplicationUser>(manager)
            {
                AllowOnlyAlphanumericUserNames = false,
                RequireUniqueEmail             = true
            };

            // Configure validation logic for passwords
            manager.PasswordValidator = new PasswordValidator
            {
                RequiredLength          = 6,
                RequireNonLetterOrDigit = true,
                RequireDigit            = true,
                RequireLowercase        = true,
                RequireUppercase        = true,
            };

            // Configure user lockout defaults
            manager.UserLockoutEnabledByDefault          = true;
            manager.DefaultAccountLockoutTimeSpan        = TimeSpan.FromMinutes(5);
            manager.MaxFailedAccessAttemptsBeforeLockout = 5;

            // Register two factor authentication providers. This application uses Phone and Emails as a step of receiving a code for verifying the user
            // You can write your own provider and plug it in here.
            manager.RegisterTwoFactorProvider("Phone Code", new PhoneNumberTokenProvider <ApplicationUser>
            {
                MessageFormat = "Your security code is {0}"
            });
            manager.RegisterTwoFactorProvider("Email Code", new EmailTokenProvider <ApplicationUser>
            {
                Subject    = "Security Code",
                BodyFormat = "Your security code is {0}"
            });
            manager.EmailService = new EmailService();
            manager.SmsService   = new SmsService();

            if (dataProtectionProvider != null)
            {
                manager.UserTokenProvider = new DataProtectorTokenProvider <ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity"));
            }

            return(manager);
        }