Example #1
0
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                GC.SuppressFinalize(this);
            }

            _pylonContext?.Dispose();
            _pylonContext = null;
            _disposed     = true;
        }
Example #2
0
 public UnitOfWork()
 {
     _pylonContext             = new PylonContext();
     UserManager               = new PylonUserManager(new UserStore <User>(_pylonContext));
     UserManager.UserValidator = new UserValidator <User>(UserManager)
     {
         AllowOnlyAlphanumericUserNames = false,
         RequireUniqueEmail             = true
     };
     UserManager.PasswordValidator = new PasswordValidator
     {
         RequiredLength          = 6,
         RequireNonLetterOrDigit = false,
         RequireDigit            = true,
         RequireLowercase        = true,
         RequireUppercase        = true,
     };
     RoleManager    = new PylonRoleManager(new RoleStore <Role>(_pylonContext));
     ProfileManager = new ProfileRepository(_pylonContext);
     ProductManager = new ProductRepository(_pylonContext);
     OrderManager   = new OrderRepository(_pylonContext);
 }
Example #3
0
 public ProfileRepository(PylonContext context) : base(context)
 {
     _pylonContext = context;
 }
Example #4
0
 public BaseRepository(PylonContext context)
 {
     _pylonContext = context;
     _dbSet        = _pylonContext.Set <TEntity>();
 }
Example #5
0
 public ProductRepository(PylonContext context) : base(context)
 {
 }
Example #6
0
 public OrderRepository(PylonContext context) : base(context)
 {
 }