Beispiel #1
0
        public UserDto ReturnCreatedUser(RegisterUserDto user)
        {
            var createdUser = _usersRepository.GetFirstWhere(x => x.Email == user.Email);
            var usersList   = new List <Users>()
            {
                createdUser
            };
            var usersDto       = ModelToDTO.ConvertUsersToDto(usersList);
            var createdUserDto = usersDto.FirstOrDefault(x => x.Id == createdUser.Id);

            return(createdUserDto);
        }
Beispiel #2
0
        public UserDto UserAccess(string token, string email)
        {
            var requestedUser = _usersRepository.GetFirstWhere(x => x.AccessToken == token && x.Email == email);

            if (requestedUser == null)
            {
                throw new FlowException("User not found!");
            }

            var usersList = new List <Users>()
            {
                requestedUser
            };
            var usersDto      = ModelToDTO.ConvertUsersToDto(usersList);
            var accessUserDto = usersDto.FirstOrDefault(x => x.Id == requestedUser.Id);

            return(accessUserDto);
        }
Beispiel #3
0
        public List <UserDto> GetAll()
        {
            var users = _usersRepository.GetAll();

            return(ModelToDTO.ConvertUsersToDto(users));
        }