make GetCompletionById return answers included (btw maybe it's not necessary)

This commit is contained in:
Вячеслав 2025-05-31 00:04:29 +05:00
parent 7d47ab9e60
commit b4e260998d

View file

@ -16,7 +16,7 @@ public class CompletionRepository : ICompletionRepository
public async Task<Completion?> GetByIdAsync(int id) public async Task<Completion?> GetByIdAsync(int id)
{ {
return await _context.Completions.FindAsync(id); return await _context.Completions.Include(c => c.Answers).FirstOrDefaultAsync(c => c.Id == id);
} }
public async Task<IEnumerable<Completion>> GetAllAsync() public async Task<IEnumerable<Completion>> GetAllAsync()