deletions update
This commit is contained in:
parent
6f8ef78577
commit
7bbcd07c39
10 changed files with 71 additions and 22 deletions
|
|
@ -25,9 +25,7 @@ public class QuestionService : IQuestionService
|
|||
|
||||
public async Task DeleteQuestionAsync(int id)
|
||||
{
|
||||
var question = await GetQuestionByIdAsync(id);
|
||||
|
||||
await _questionRepository.DeleteAsync(question);
|
||||
await _questionRepository.DeleteAsync(id);
|
||||
}
|
||||
|
||||
public async Task<QuestionBase> GetQuestionByIdAsync(int id)
|
||||
|
|
|
|||
|
|
@ -25,13 +25,7 @@ public class SurveyService : ISurveyService
|
|||
|
||||
public async Task DeleteSurveyAsync(int id)
|
||||
{
|
||||
var survey = await _surveyRepository.GetByIdAsync(id);
|
||||
if (survey == null)
|
||||
{
|
||||
throw new NullReferenceException($"Survey with id: {id} was not found");
|
||||
}
|
||||
|
||||
await _surveyRepository.DeleteAsync(survey);
|
||||
await _surveyRepository.DeleteAsync(id);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Survey>> GetSurveysAsync()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue