Beispiel #1
0
        public static AppUserManager Create(IdentityFactoryOptions <AppUserManager> options,
                                            IOwinContext context)
        {
            GameShopContext db      = context.Get <GameShopContext>();
            AppUserManager  manager = new AppUserManager(new UserStore <User>(db));

            manager.PasswordValidator = new PasswordValidator()
            {
                RequiredLength   = 6,
                RequireDigit     = true,
                RequireLowercase = true,
                RequireUppercase = true
            };

            manager.UserValidator = new UserValidator <User>(manager)
            {
                AllowOnlyAlphanumericUserNames = false,
                RequireUniqueEmail             = true
            };

            var provider = new DpapiDataProtectionProvider("SampleAppName");

            manager.UserTokenProvider = new DataProtectorTokenProvider <User>(provider.Create("SampleTokenName"));

            manager.EmailService = new EmailService();

            return(manager);
        }
Beispiel #2
0
 public UnitOfWork(GameShopContext context)
 {
     _context           = context;
     Products           = new ProductRepository(_context);
     Categories         = new CategoryRepository(_context);
     Carts              = new CartRepository(_context);
     Orders             = new OrderRepository(_context);
     ProductImages      = new ProductImageRepository(_context);
     ParameterGroups    = new ParameterGroupRepository(_context);
     ParameterSubGroups = new ParameterSubGroupRepository(_context);
     ParameterValues    = new ParameterValueRepository(_context);
     WishLists          = new WishListRepository(_context);
 }