aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Data/Repositories/FeedRepository.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DevHive.Data/Repositories/FeedRepository.cs')
-rw-r--r--src/DevHive.Data/Repositories/FeedRepository.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/DevHive.Data/Repositories/FeedRepository.cs b/src/DevHive.Data/Repositories/FeedRepository.cs
index 271c3a5..8d3e5e1 100644
--- a/src/DevHive.Data/Repositories/FeedRepository.cs
+++ b/src/DevHive.Data/Repositories/FeedRepository.cs
@@ -18,6 +18,15 @@ namespace DevHive.Data.Repositories
this._context = context;
}
+ /// <summary>
+ /// This returns a given amount of posts of all given friends, created before "firstRequestIssued",
+ /// ordered from latest to oldest (time created).
+ /// PageSize specifies how many posts to get, and pageNumber specifices how many posts to skip (pageNumber * pageSize).
+ ///
+ /// This method is used in the feed page.
+ /// Posts from friends are meant to be gotten in chunks, meaning you get X posts, and then get another amount of posts,
+ /// that are after the first X posts.
+ /// </summary>
public async Task<List<Post>> GetFriendsPosts(List<User> friendsList, DateTime firstRequestIssued, int pageNumber, int pageSize)
{
List<Guid> friendsIds = friendsList.Select(f => f.Id).ToList();
@@ -39,6 +48,15 @@ namespace DevHive.Data.Repositories
return posts;
}
+ /// <summary>
+ /// This returns a given amount of posts, that a user has made, created before "firstRequestIssued",
+ /// ordered from latest to oldest (time created).
+ /// PageSize specifies how many posts to get, and pageNumber specifices how many posts to skip (pageNumber * pageSize).
+ ///
+ /// This method is used in the profile page.
+ /// Posts from friends are meant to be gotten in chunks, meaning you get X posts, and then get another amount of posts,
+ /// that are after the first X posts.
+ /// </summary>
public async Task<List<Post>> GetUsersPosts(User user, DateTime firstRequestIssued, int pageNumber, int pageSize)
{
List<Post> posts = await this._context.Posts