From 8124cfe758b9c8464589fb15a3fefd45173f9f3d Mon Sep 17 00:00:00 2001 From: shept Date: Sun, 20 Apr 2025 19:38:39 +0500 Subject: [PATCH] include AnswerVariants when getting questions by surveyid --- .../Repositories/QuestionRepository.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SurveyLib.Infrastructure.EFCore/Repositories/QuestionRepository.cs b/SurveyLib.Infrastructure.EFCore/Repositories/QuestionRepository.cs index 59ca2f7..5a8b82e 100644 --- a/SurveyLib.Infrastructure.EFCore/Repositories/QuestionRepository.cs +++ b/SurveyLib.Infrastructure.EFCore/Repositories/QuestionRepository.cs @@ -44,6 +44,6 @@ public class QuestionRepository : IQuestionRepository public async Task> GetQuestionsBySurveyId(int surveyId) { - return await _context.Questions.Where(q => q.SurveyId == surveyId).ToListAsync(); + return await _context.Questions.Include(q => q.AnswerVariants).Where(q => q.SurveyId == surveyId).ToListAsync(); } } \ No newline at end of file