aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-02-04 15:00:39 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-02-04 15:00:39 +0200
commita11d023c0e6557baef6b420771e31f9ac0f4b1e2 (patch)
tree6df33d5ea6b2573ed4c90ee63cb9e0be52865510
parentd969e5fd4055ff91113c8e00f57d58c077277414 (diff)
downloadDevHive-a11d023c0e6557baef6b420771e31f9ac0f4b1e2.tar
DevHive-a11d023c0e6557baef6b420771e31f9ac0f4b1e2.tar.gz
DevHive-a11d023c0e6557baef6b420771e31f9ac0f4b1e2.zip
Added some XML documentation in data layer
-rw-r--r--src/DevHive.Data/Repositories/CommentRepository.cs3
-rw-r--r--src/DevHive.Data/Repositories/FeedRepository.cs18
-rw-r--r--src/DevHive.Data/Repositories/LanguageRepository.cs3
-rw-r--r--src/DevHive.Data/Repositories/PostRepository.cs3
-rw-r--r--src/DevHive.Data/Repositories/TechnologyRepository.cs3
5 files changed, 30 insertions, 0 deletions
diff --git a/src/DevHive.Data/Repositories/CommentRepository.cs b/src/DevHive.Data/Repositories/CommentRepository.cs
index 382c666..bee7624 100644
--- a/src/DevHive.Data/Repositories/CommentRepository.cs
+++ b/src/DevHive.Data/Repositories/CommentRepository.cs
@@ -28,6 +28,9 @@ namespace DevHive.Data.Repositories
.FirstOrDefaultAsync(x => x.Id == id);
}
+ /// <summary>
+ /// This method returns the comment that is made at exactly the given time and by the given creator
+ /// </summary>
public async Task<Comment> GetCommentByIssuerAndTimeCreatedAsync(Guid issuerId, DateTime timeCreated)
{
return await this._context.Comments
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
diff --git a/src/DevHive.Data/Repositories/LanguageRepository.cs b/src/DevHive.Data/Repositories/LanguageRepository.cs
index 7f4b946..31d0b86 100644
--- a/src/DevHive.Data/Repositories/LanguageRepository.cs
+++ b/src/DevHive.Data/Repositories/LanguageRepository.cs
@@ -25,6 +25,9 @@ namespace DevHive.Data.Repositories
.FirstOrDefaultAsync(x => x.Name == languageName);
}
+ /// <summary>
+ /// Returns all technologies that exist in the database
+ /// </summary>
public HashSet<Language> GetLanguages()
{
return this._context.Languages.ToHashSet();
diff --git a/src/DevHive.Data/Repositories/PostRepository.cs b/src/DevHive.Data/Repositories/PostRepository.cs
index 0fec435..ed2fa1b 100644
--- a/src/DevHive.Data/Repositories/PostRepository.cs
+++ b/src/DevHive.Data/Repositories/PostRepository.cs
@@ -39,6 +39,9 @@ namespace DevHive.Data.Repositories
.FirstOrDefaultAsync(x => x.Id == id);
}
+ /// <summary>
+ /// This method returns the post that is made at exactly the given time and by the given creator
+ /// </summary>
public async Task<Post> GetPostByCreatorAndTimeCreatedAsync(Guid creatorId, DateTime timeCreated)
{
return await this._context.Posts
diff --git a/src/DevHive.Data/Repositories/TechnologyRepository.cs b/src/DevHive.Data/Repositories/TechnologyRepository.cs
index 7bb43cc..6f0d10f 100644
--- a/src/DevHive.Data/Repositories/TechnologyRepository.cs
+++ b/src/DevHive.Data/Repositories/TechnologyRepository.cs
@@ -25,6 +25,9 @@ namespace DevHive.Data.Repositories
.FirstOrDefaultAsync(x => x.Name == technologyName);
}
+ /// <summary>
+ /// Returns all technologies that exist in the database
+ /// </summary>
public HashSet<Technology> GetTechnologies()
{
return this._context.Technologies.ToHashSet();