public async Task <IEnumerable <UserDto> > GetFriendsAsync(FriendPaginationModel model) { User user = await userService.GetUserEntityByIdAsync(model.UserId); IEnumerable <User> friends = user?.FriendsFrom.Union(user.FriendsTo); if (friends is null) { return(null); } return(paginationService.MakePage(model, friends)); }
public async Task <IActionResult> GetFriendsAsync([FromQuery] FriendPaginationModel model) { return(this.ConvertResult( await friendService.GetFriendsAsync(model))); }