Пример #1
0
        public virtual UserRoleStateRemovedDto NewUserRoleStateRemoved(string roleId)
        {
            var e   = new UserRoleStateRemovedDto();
            var eId = NewUserRoleEventId(roleId);

            e.UserRoleEventId = eId;
            return(e);
        }
        public virtual UserRoleStateRemovedDto ToUserRoleStateRemovedDto(IUserRoleStateRemoved e)
        {
            var dto = new UserRoleStateRemovedDto();

            dto.UserRoleEventId = e.UserRoleEventId;
            dto.CreatedAt       = e.CreatedAt;
            dto.CreatedBy       = e.CreatedBy;
            dto.Version         = e.Version;
            dto.CommandId       = e.CommandId;

            return(dto);
        }
Пример #3
0
        public virtual UserStateDeletedDto ToUserStateDeletedDto(IUserStateDeleted e)
        {
            var dto = new UserStateDeletedDto();

            dto.StateEventId = new UserStateEventIdDtoWrapper(e.StateEventId);
            dto.CreatedAt    = e.CreatedAt;
            dto.CreatedBy    = e.CreatedBy;
            dto.CommandId    = e.CommandId;
            var userRoleEvents = new List <UserRoleStateRemovedDto>();

            foreach (var ee in e.UserRoleEvents)
            {
                UserRoleStateRemovedDto eeDto = UserRoleStateEventDtoConverter.ToUserRoleStateRemovedDto(ee);
                userRoleEvents.Add(eeDto);
            }
            dto.UserRoleEvents = userRoleEvents.ToArray();

            var userClaimEvents = new List <UserClaimStateRemovedDto>();

            foreach (var ee in e.UserClaimEvents)
            {
                UserClaimStateRemovedDto eeDto = UserClaimStateEventDtoConverter.ToUserClaimStateRemovedDto(ee);
                userClaimEvents.Add(eeDto);
            }
            dto.UserClaimEvents = userClaimEvents.ToArray();

            var userPermissionEvents = new List <UserPermissionStateRemovedDto>();

            foreach (var ee in e.UserPermissionEvents)
            {
                UserPermissionStateRemovedDto eeDto = UserPermissionStateEventDtoConverter.ToUserPermissionStateRemovedDto(ee);
                userPermissionEvents.Add(eeDto);
            }
            dto.UserPermissionEvents = userPermissionEvents.ToArray();

            var userLoginEvents = new List <UserLoginStateRemovedDto>();

            foreach (var ee in e.UserLoginEvents)
            {
                UserLoginStateRemovedDto eeDto = UserLoginStateEventDtoConverter.ToUserLoginStateRemovedDto(ee);
                userLoginEvents.Add(eeDto);
            }
            dto.UserLoginEvents = userLoginEvents.ToArray();


            return(dto);
        }