Beispiel #1
0
        public virtual UserPermissionStateCreatedDto NewUserPermissionStateCreated(string permissionId)
        {
            var e   = new UserPermissionStateCreatedDto();
            var eId = NewUserPermissionEventId(permissionId);

            e.UserPermissionEventId = eId;
            return(e);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public virtual UserPermissionStateCreatedDto ToUserPermissionStateCreatedDto(IUserPermissionStateCreated e)
        {
            var dto = new UserPermissionStateCreatedDto();

            dto.StateEventId = new UserPermissionStateEventIdDtoWrapper(e.StateEventId);
            dto.CreatedAt    = e.CreatedAt;
            dto.CreatedBy    = e.CreatedBy;
            dto.Version      = e.Version;
            dto.CommandId    = e.CommandId;
            dto.Active       = e.Active;
            return(dto);
        }