aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Data/Repositories/RatingRepository.cs
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-02-01 16:03:38 +0200
committertranstrike <transtrike@gmail.com>2021-02-01 16:03:38 +0200
commitb41f887712ef8f2f0b602da3042261a78c5f492a (patch)
treefb6437ea34896da7c7db3a292bbdb8ee7d14e889 /src/DevHive.Data/Repositories/RatingRepository.cs
parentaa342542789b22f24ce3ecbfcb7888d4ff12d30c (diff)
downloadDevHive-b41f887712ef8f2f0b602da3042261a78c5f492a.tar
DevHive-b41f887712ef8f2f0b602da3042261a78c5f492a.tar.gz
DevHive-b41f887712ef8f2f0b602da3042261a78c5f492a.zip
Commented out implementation of Rating; Bug fixes
Diffstat (limited to 'src/DevHive.Data/Repositories/RatingRepository.cs')
-rw-r--r--src/DevHive.Data/Repositories/RatingRepository.cs19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/DevHive.Data/Repositories/RatingRepository.cs b/src/DevHive.Data/Repositories/RatingRepository.cs
index 43fe90d..d676f27 100644
--- a/src/DevHive.Data/Repositories/RatingRepository.cs
+++ b/src/DevHive.Data/Repositories/RatingRepository.cs
@@ -9,29 +9,26 @@ namespace DevHive.Data.Repositories
public class RatingRepository : BaseRepository<Rating>, IRatingRepository
{
private readonly DevHiveContext _context;
+ private readonly IPostRepository _postRepository;
- public RatingRepository(DevHiveContext context)
+ public RatingRepository(DevHiveContext context, IPostRepository postRepository)
: base(context)
{
this._context = context;
+ this._postRepository = postRepository;
}
public async Task<Rating> GetByPostId(Guid postId)
{
- return await this._context.Rating
- .FirstOrDefaultAsync(x => x.Post.Id == postId);
- }
-
- public async Task<Tuple<int, int>> GetRating(Guid postId)
- {
- Rating rating = await this.GetByPostId(postId);
-
- return new Tuple<int, int>(rating.Likes, rating.Dislikes);
+ throw new NotImplementedException();
+ // return await this._context.Rating
+ // .FirstOrDefaultAsync(x => x.Post.Id == postId);
}
- public async Task<bool> HasUserRatedThisPost(Guid userId, Guid postId)
+ public async Task<int> GetRating(Guid postId)
{
throw new NotImplementedException();
+ // return (await this.GetByPostId(postId)).Rate;
}
}
}