Exemplo n.º 1
0
 /// <summary>
 /// Dispose unmanaged resources and/or set large fields
 /// (managed/unmanaged) to null. This method will be called whether
 /// the <see cref="Disposable.Dispose()"/> method is called by the
 /// finalizer or your code.
 /// </summary>
 protected override void DisposeExtra()
 {
     _unitOfWork    = null;
     _userRepo      = null;
     _roleRepo      = null;
     _userLoginRepo = null;
     _userRoleRepo  = null;
     _userClaimRepo = null;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize a new instance of the class with unit of work.
        /// </summary>
        /// <param name="unitOfWork">Unit of work reference.</param>
        public UserStore(IUnitOfWork unitOfWork)
        {
            if (unitOfWork == null)
            {
                throw new ArgumentNullException("UnitOfWork null");
            }

            _unitOfWork     = unitOfWork;
            AutoSaveChanges = true;
            _userRepo       = new UserRepository <TUser, TKey, TUserLogin, TUserRole, TUserClaim>(_unitOfWork);
            _roleRepo       = new RoleRepository <TRole, TKey, TUserRole>(_unitOfWork);
            _userLoginRepo  = new UserLoginRepository <TUserLogin, TKey>(_unitOfWork);
            _userRoleRepo   = new UserRoleRepository <TUserRole, TKey>(_unitOfWork);
            _userClaimRepo  = new UserClaimRepository <TUserClaim, TKey>(_unitOfWork);
        }