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 })); }
public IEnumerable <UserDTO> GetAllUsers() { return(usersDAL.GetAllUsers()); }
public IEnumerable <User> GetAllUsers() => _usersDAL.GetAllUsers();