minor repositories changes

This commit is contained in:
Вячеслав 2025-04-16 17:57:03 +05:00
parent 845db13c63
commit 3e570decd7
2 changed files with 6 additions and 1 deletions

View file

@ -4,5 +4,5 @@ namespace SurveyLib.Core.Repositories;
public interface IQuestionRepository : IGenericRepository<QuestionBase> public interface IQuestionRepository : IGenericRepository<QuestionBase>
{ {
public IEnumerable<QuestionBase> GetQuestionsBySurveyId(int surveyId);
} }

View file

@ -41,4 +41,9 @@ public class QuestionRepository : IQuestionRepository
_context.Questions.Remove(entity); _context.Questions.Remove(entity);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
} }
public IEnumerable<QuestionBase> GetQuestionsBySurveyId(int surveyId)
{
return _context.Questions.Where(q => q.SurveyId == surveyId);
}
} }