Ejemplo n.º 1
0
        public virtual IUserPermissionMvoStateEvent GetStateEvent(UserPermissionId userPermissionId, long version)
        {
            var e = (IUserPermissionMvoStateEvent)EventStore.GetStateEvent(ToEventStoreAggregateId(userPermissionId), version);

            if (e != null)
            {
                e.ReadOnly = true;
            }
            return(e);
        }
Ejemplo n.º 2
0
        public virtual IUserPermissionMvoState Get(UserPermissionId userPermissionId)
        {
            var state = StateRepository.Get(userPermissionId);

            if (state != null && state.IsUnsaved)
            {
                state = null;
            }

            return(state);
        }
Ejemplo n.º 3
0
        public virtual IUserPermissionState Get(string permissionId)
        {
            UserPermissionId globalId = new UserPermissionId(_userState.UserId, permissionId);

            if (_loadedUserPermissionStates.ContainsKey(globalId))
            {
                return(_loadedUserPermissionStates[globalId]);
            }
            var state = UserPermissionStateDao.Get(globalId);

            _loadedUserPermissionStates.Add(globalId, state);
            return(state);
        }
Ejemplo n.º 4
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            UserPermissionId other = obj as UserPermissionId;

            if (other == null)
            {
                return(false);
            }

            return(true &&
                   Object.Equals(this.UserId, other.UserId) &&
                   Object.Equals(this.PermissionId, other.PermissionId)
                   );
        }
 public UserPermissionMvoStateEventId(UserPermissionId userPermissionId, long userVersion)
 {
     this._userPermissionId = userPermissionId;
     this._userVersion      = userVersion;
 }
Ejemplo n.º 6
0
 public UserPermissionIdFlattenedDto(UserPermissionId val)
 {
     this._value = val;
 }
Ejemplo n.º 7
0
 public abstract IEventStoreAggregateId ToEventStoreAggregateId(UserPermissionId aggregateId);