aboutsummaryrefslogtreecommitdiff
path: root/src/Data/DevHive.Data/Repositories
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-02-13 18:36:25 +0200
committertranstrike <transtrike@gmail.com>2021-02-13 18:36:25 +0200
commit018e9d303c38407589f06ec37a4a72dc4ce8e3b4 (patch)
tree05387c66338796a4c207c3bcbeca454329a28120 /src/Data/DevHive.Data/Repositories
parentd9b9685204ece098df5a2425246a10bf65004b0f (diff)
downloadDevHive-018e9d303c38407589f06ec37a4a72dc4ce8e3b4.tar
DevHive-018e9d303c38407589f06ec37a4a72dc4ce8e3b4.tar.gz
DevHive-018e9d303c38407589f06ec37a4a72dc4ce8e3b4.zip
Merged New Project Structure; Fixed Kamen's Formatting Issues
Diffstat (limited to 'src/Data/DevHive.Data/Repositories')
-rw-r--r--src/Data/DevHive.Data/Repositories/CommentRepository.cs5
-rw-r--r--src/Data/DevHive.Data/Repositories/FeedRepository.cs8
-rw-r--r--src/Data/DevHive.Data/Repositories/LanguageRepository.cs4
-rw-r--r--src/Data/DevHive.Data/Repositories/PostRepository.cs10
-rw-r--r--src/Data/DevHive.Data/Repositories/TechnologyRepository.cs4
5 files changed, 15 insertions, 16 deletions
diff --git a/src/Data/DevHive.Data/Repositories/CommentRepository.cs b/src/Data/DevHive.Data/Repositories/CommentRepository.cs
index c63fe65..9364776 100644
--- a/src/Data/DevHive.Data/Repositories/CommentRepository.cs
+++ b/src/Data/DevHive.Data/Repositories/CommentRepository.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using DevHive.Data.Interfaces;
@@ -29,8 +28,8 @@ namespace DevHive.Data.Repositories
}
/// <summary>
- /// This method returns the comment that is made at exactly the given time and by the given creator
- /// </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/Data/DevHive.Data/Repositories/FeedRepository.cs b/src/Data/DevHive.Data/Repositories/FeedRepository.cs
index 8899675..d3312d7 100644
--- a/src/Data/DevHive.Data/Repositories/FeedRepository.cs
+++ b/src/Data/DevHive.Data/Repositories/FeedRepository.cs
@@ -19,14 +19,14 @@ namespace DevHive.Data.Repositories
}
/// <summary>
- /// This returns a given amount of posts of all given friends, created before "firstRequestIssued",
+ /// 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>
+ /// </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();
@@ -49,14 +49,14 @@ namespace DevHive.Data.Repositories
}
/// <summary>
- /// This returns a given amount of posts, that a user has made, created before "firstRequestIssued",
+ /// 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>
+ /// </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/Data/DevHive.Data/Repositories/LanguageRepository.cs b/src/Data/DevHive.Data/Repositories/LanguageRepository.cs
index 61f4792..3528ea8 100644
--- a/src/Data/DevHive.Data/Repositories/LanguageRepository.cs
+++ b/src/Data/DevHive.Data/Repositories/LanguageRepository.cs
@@ -26,8 +26,8 @@ namespace DevHive.Data.Repositories
}
/// <summary>
- /// Returns all technologies that exist in the database
- /// </summary>
+ /// Returns all technologies that exist in the database
+ /// </summary>
public HashSet<Language> GetLanguages()
{
return this._context.Languages.ToHashSet();
diff --git a/src/Data/DevHive.Data/Repositories/PostRepository.cs b/src/Data/DevHive.Data/Repositories/PostRepository.cs
index d35c475..b6c5e37 100644
--- a/src/Data/DevHive.Data/Repositories/PostRepository.cs
+++ b/src/Data/DevHive.Data/Repositories/PostRepository.cs
@@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore;
namespace DevHive.Data.Repositories
{
- public class PostRepository : BaseRepository<Post>, IPostRepository
+ public class PostRepository : BaseRepository<Post>, IPostRepository
{
private readonly DevHiveContext _context;
private readonly IUserRepository _userRepository;
@@ -41,8 +41,8 @@ namespace DevHive.Data.Repositories
}
/// <summary>
- /// This method returns the post that is made at exactly the given time and by the given creator
- /// </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
@@ -68,12 +68,12 @@ namespace DevHive.Data.Repositories
.SetValues(newEntity);
List<PostAttachments> postAttachments = new();
- foreach(var attachment in newEntity.Attachments)
+ foreach (var attachment in newEntity.Attachments)
postAttachments.Add(attachment);
post.Attachments = postAttachments;
post.Comments.Clear();
- foreach(var comment in newEntity.Comments)
+ foreach (var comment in newEntity.Comments)
post.Comments.Add(comment);
// post.Rating.Id = ratingId;
diff --git a/src/Data/DevHive.Data/Repositories/TechnologyRepository.cs b/src/Data/DevHive.Data/Repositories/TechnologyRepository.cs
index 8cb7da1..d0d1f3f 100644
--- a/src/Data/DevHive.Data/Repositories/TechnologyRepository.cs
+++ b/src/Data/DevHive.Data/Repositories/TechnologyRepository.cs
@@ -26,8 +26,8 @@ namespace DevHive.Data.Repositories
}
/// <summary>
- /// Returns all technologies that exist in the database
- /// </summary>
+ /// Returns all technologies that exist in the database
+ /// </summary>
public HashSet<Technology> GetTechnologies()
{
return this._context.Technologies.ToHashSet();