diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-01-28 20:20:41 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-01-28 20:20:41 +0200 |
| commit | 702e947c20cbdc2c5aaacfa0e8172bfc97912dd2 (patch) | |
| tree | 4b2569ff82383658cd3e8dc3c8fa91c8785337a0 /src/DevHive.Data | |
| parent | 9fd19d0c584fb07107319d07c9a5b571a4ab47dd (diff) | |
| download | DevHive-702e947c20cbdc2c5aaacfa0e8172bfc97912dd2.tar DevHive-702e947c20cbdc2c5aaacfa0e8172bfc97912dd2.tar.gz DevHive-702e947c20cbdc2c5aaacfa0e8172bfc97912dd2.zip | |
Updated comments and posts to use Creator.Id, rather than CreatorId; updated service to give Posts and Comments the post and creator objects from db
Diffstat (limited to 'src/DevHive.Data')
| -rw-r--r-- | src/DevHive.Data/Repositories/CommentRepository.cs | 2 | ||||
| -rw-r--r-- | src/DevHive.Data/Repositories/FeedRepository.cs | 2 | ||||
| -rw-r--r-- | src/DevHive.Data/Repositories/PostRepository.cs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/DevHive.Data/Repositories/CommentRepository.cs b/src/DevHive.Data/Repositories/CommentRepository.cs index 006326a..d33b7bf 100644 --- a/src/DevHive.Data/Repositories/CommentRepository.cs +++ b/src/DevHive.Data/Repositories/CommentRepository.cs @@ -20,7 +20,7 @@ namespace DevHive.Data.Repositories public async Task<Comment> GetCommentByIssuerAndTimeCreatedAsync(Guid issuerId, DateTime timeCreated) { return await this._context.Comments - .FirstOrDefaultAsync(p => p.CreatorId == issuerId && + .FirstOrDefaultAsync(p => p.Creator.Id == issuerId && p.TimeCreated == timeCreated); } #endregion diff --git a/src/DevHive.Data/Repositories/FeedRepository.cs b/src/DevHive.Data/Repositories/FeedRepository.cs index 1b7518d..efcb8e0 100644 --- a/src/DevHive.Data/Repositories/FeedRepository.cs +++ b/src/DevHive.Data/Repositories/FeedRepository.cs @@ -24,7 +24,7 @@ namespace DevHive.Data.Repositories List<Post> posts = await this._context.Posts .Where(post => post.TimeCreated < firstRequestIssued) - .Where(p => friendsIds.Contains(p.CreatorId)) + .Where(p => friendsIds.Contains(p.Creator.Id)) .OrderByDescending(x => x.TimeCreated) .Skip((pageNumber - 1) * pageSize) .Take(pageSize) diff --git a/src/DevHive.Data/Repositories/PostRepository.cs b/src/DevHive.Data/Repositories/PostRepository.cs index e8180de..67988f2 100644 --- a/src/DevHive.Data/Repositories/PostRepository.cs +++ b/src/DevHive.Data/Repositories/PostRepository.cs @@ -27,7 +27,7 @@ namespace DevHive.Data.Repositories public async Task<Post> GetPostByCreatorAndTimeCreatedAsync(Guid creatorId, DateTime timeCreated) { return await this._context.Posts - .FirstOrDefaultAsync(p => p.CreatorId == creatorId && + .FirstOrDefaultAsync(p => p.Creator.Id == creatorId && p.TimeCreated == timeCreated); } #endregion |
