diff --git a/WF_EF_Api/Contextlib/DbCommentaryManager.cs b/WF_EF_Api/Contextlib/DbCommentaryManager.cs index b18ae99..f39e4df 100644 --- a/WF_EF_Api/Contextlib/DbCommentaryManager.cs +++ b/WF_EF_Api/Contextlib/DbCommentaryManager.cs @@ -76,13 +76,13 @@ namespace Contextlib public async Task> GetAllCommentary() { - var comments = await _context.comments.Include(c => c.User).ToListAsync(); + var comments = await _context.comments.Include(c => c.User).Include(c=>c.User.Images).ToListAsync(); return new PaginationResult(comments.Count, 0, comments.Count, comments); } public async Task GetCommentaryById(int id) { - var comment = await _context.comments.Include(c => c.User).Where(x => x.Id == id).FirstOrDefaultAsync(); + var comment = await _context.comments.Include(c => c.User).Include(c => c.User.Images).Where(x => x.Id == id).FirstOrDefaultAsync(); if(comment == null) { throw new KeyNotFoundException($"No comments found with the given ID: {id}."); @@ -92,7 +92,7 @@ namespace Contextlib public async Task> GetCommentaryByQuote(int quoteId, int index, int pageSize) { - var comments = await _context.comments.Include(c => c.User).Where(x => x.IdQuote == quoteId).ToListAsync(); + var comments = await _context.comments.Include(c => c.User).Include(c => c.User.Images).Where(x => x.IdQuote == quoteId).ToListAsync(); if (!comments.Any()) { throw new KeyNotFoundException($"No comments found for the quote ID: {quoteId}.");