overthinking repositories from scratch
This commit is contained in:
parent
58271df949
commit
845db13c63
8 changed files with 4 additions and 51 deletions
|
|
@ -41,15 +41,4 @@ public class QuestionRepository : IQuestionRepository
|
|||
_context.Questions.Remove(entity);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task<QuestionBase?> GetWithAnswersAsync(int questionId)
|
||||
{
|
||||
return await _context.Questions.Include(q => q.Answers)
|
||||
.FirstOrDefaultAsync(q => q.Id == questionId);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<QuestionBase>> GetBySurveyIdAsync(int surveyId)
|
||||
{
|
||||
return await _context.Questions.Where(q => q.SurveyId == surveyId).ToListAsync();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue