From a11d023c0e6557baef6b420771e31f9ac0f4b1e2 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 4 Feb 2021 15:00:39 +0200 Subject: Added some XML documentation in data layer --- src/DevHive.Data/Repositories/CommentRepository.cs | 3 +++ src/DevHive.Data/Repositories/FeedRepository.cs | 18 ++++++++++++++++++ src/DevHive.Data/Repositories/LanguageRepository.cs | 3 +++ src/DevHive.Data/Repositories/PostRepository.cs | 3 +++ src/DevHive.Data/Repositories/TechnologyRepository.cs | 3 +++ 5 files changed, 30 insertions(+) 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); } + /// + /// This method returns the comment that is made at exactly the given time and by the given creator + /// public async Task 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; } + /// + /// 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. + /// public async Task> GetFriendsPosts(List friendsList, DateTime firstRequestIssued, int pageNumber, int pageSize) { List friendsIds = friendsList.Select(f => f.Id).ToList(); @@ -39,6 +48,15 @@ namespace DevHive.Data.Repositories return posts; } + /// + /// 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. + /// public async Task> GetUsersPosts(User user, DateTime firstRequestIssued, int pageNumber, int pageSize) { List 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); } + /// + /// Returns all technologies that exist in the database + /// public HashSet 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); } + /// + /// This method returns the post that is made at exactly the given time and by the given creator + /// public async Task 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); } + /// + /// Returns all technologies that exist in the database + /// public HashSet GetTechnologies() { return this._context.Technologies.ToHashSet(); -- cgit v1.2.3