From b4e260998d4191b7068054b404c8a6c20ef36988 Mon Sep 17 00:00:00 2001 From: shept Date: Sat, 31 May 2025 00:04:29 +0500 Subject: [PATCH] make GetCompletionById return answers included (btw maybe it's not necessary) --- .../Repositories/CompletionRepository.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SurveyLib.Infrastructure.EFCore/Repositories/CompletionRepository.cs b/SurveyLib.Infrastructure.EFCore/Repositories/CompletionRepository.cs index bc1c39c..489cd9d 100644 --- a/SurveyLib.Infrastructure.EFCore/Repositories/CompletionRepository.cs +++ b/SurveyLib.Infrastructure.EFCore/Repositories/CompletionRepository.cs @@ -16,7 +16,7 @@ public class CompletionRepository : ICompletionRepository public async Task 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> GetAllAsync()