diff options
Diffstat (limited to 'src/Data/DevHive.Data/Repositories/RatingRepository.cs')
| -rw-r--r-- | src/Data/DevHive.Data/Repositories/RatingRepository.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Data/DevHive.Data/Repositories/RatingRepository.cs b/src/Data/DevHive.Data/Repositories/RatingRepository.cs index b361693..2f56aee 100644 --- a/src/Data/DevHive.Data/Repositories/RatingRepository.cs +++ b/src/Data/DevHive.Data/Repositories/RatingRepository.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using DevHive.Data.Interfaces; @@ -19,10 +20,10 @@ namespace DevHive.Data.Repositories this._postRepository = postRepository; } - public async Task<Rating> GetRatingByPostId(Guid postId) + public async Task<List<Rating>> GetRatingsByPostId(Guid postId) { return await this._context.Rating - .FirstOrDefaultAsync(x => x.Post.Id == postId); + .Where(x => x.Post.Id == postId).ToListAsync(); } public async Task<bool> UserRatedPost(Guid userId, Guid postId) |
