overthinking repositories from scratch

This commit is contained in:
Вячеслав 2025-04-16 17:32:24 +05:00
parent 58271df949
commit 845db13c63
8 changed files with 4 additions and 51 deletions

View file

@ -41,14 +41,4 @@ public class AnswerRepository : IAnswerRepository
_context.Answers.Remove(entity);
await _context.SaveChangesAsync();
}
public async Task<IEnumerable<Answer>> GetByAttemptIdAsync(int attemptId)
{
return await _context.Answers.Where(a => a.CompletionId == attemptId).ToListAsync();
}
public async Task<IEnumerable<Answer>> GetByQuestionIdAsync(int questionId)
{
return await _context.Answers.Where(a => a.QuestionId == questionId).ToListAsync();
}
}