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); }
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); }
public List <UserDto> GetAll() { var users = _usersRepository.GetAll(); return(ModelToDTO.ConvertUsersToDto(users)); }