예제 #1
0
        public virtual UserStateCreatedDto ToUserStateCreatedDto(IUserStateCreated e)
        {
            var dto = new UserStateCreatedDto();

            dto.StateEventId         = new UserStateEventIdDtoWrapper(e.StateEventId);
            dto.CreatedAt            = e.CreatedAt;
            dto.CreatedBy            = e.CreatedBy;
            dto.CommandId            = e.CommandId;
            dto.UserName             = e.UserName;
            dto.AccessFailedCount    = e.AccessFailedCount;
            dto.Email                = e.Email;
            dto.EmailConfirmed       = e.EmailConfirmed;
            dto.LockoutEnabled       = e.LockoutEnabled;
            dto.LockoutEndDateUtc    = e.LockoutEndDateUtc;
            dto.PasswordHash         = e.PasswordHash;
            dto.PhoneNumber          = e.PhoneNumber;
            dto.PhoneNumberConfirmed = e.PhoneNumberConfirmed;
            dto.TwoFactorEnabled     = e.TwoFactorEnabled;
            dto.SecurityStamp        = e.SecurityStamp;
            dto.Active               = e.Active;
            var userRoleEvents = new List <UserRoleStateCreatedDto>();

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

            var userClaimEvents = new List <UserClaimStateCreatedDto>();

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

            var userPermissionEvents = new List <UserPermissionStateCreatedDto>();

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

            var userLoginEvents = new List <UserLoginStateCreatedDto>();

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

            return(dto);
        }
예제 #2
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);
        }