adapt repository features to services needs
This commit is contained in:
parent
3961dbeb69
commit
9f6d5b575e
4 changed files with 18 additions and 1 deletions
|
|
@ -47,4 +47,14 @@ public class AnswerRepository : IAnswerRepository
|
|||
.ExecuteDeleteAsync();
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Answer>> GetAnswersByCompletionIdAsync(int completionId)
|
||||
{
|
||||
return await _context.Answers.Where(a => a.CompletionId == completionId).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Answer>> GetAnswersByQuestionIdAsync(int questionId)
|
||||
{
|
||||
return await _context.Answers.Where(a => a.QuestionId == questionId).ToListAsync();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue