Exemplo n.º 1
0
 public IEnumerable <UserDTO> GetUsersByImage(Guid imageId)
 {
     if (imageId == null)
     {
         throw new ArgumentNullException("image id is null");
     }
     try
     {
         imagesDAL.GetImageById(imageId);
     }
     catch (Exception e)
     {
         throw new ArgumentException("image id is incorrect, image doesn't exist", e);
     }
     return(usersDAL.GetAllUsers().Join(relationsDAL.GetUsersIdsByImageId(imageId),
                                        user => user.Id, userId => userId, (user, userId) => new UserDTO
     {
         Id = userId, FirstName = user.FirstName, DateOfBirth = user.DateOfBirth, Email = user.Email, HashOfPassword = user.HashOfPassword, LastName = user.LastName, Nickname = user.Nickname
     }));
 }
Exemplo n.º 2
0
 public IEnumerable <UserDTO> GetAllUsers()
 {
     return(usersDAL.GetAllUsers());
 }
Exemplo n.º 3
0
 public IEnumerable <User> GetAllUsers() => _usersDAL.GetAllUsers();