public async Task <IEnumerable <ShowTestQuestionAnswers> > ShowAllDeletedTestQuestions(int TestId) { var test = await testRepository.GetTest(TestId); if (test == null) { return(null); } var list = new List <ShowTestQuestionAnswers>(); if (test == null) { return(null); } var questions = await testQuestionRepository.GetAllDeletedTestQuestions(TestId); if (questions == null) { return(null); } foreach (var testQuestion in questions) { ShowTestQuestionAnswers show = new ShowTestQuestionAnswers(); show.QuestionId = testQuestion.Id.ToString(); show.Question = testQuestion.Question; var answers = await answersRepository.GetDeletedAnswersForQuestion(testQuestion.NumberOfIdentification); if (answers == null) { return(null); } foreach (var listAnswers in answers) { show.Option.Add(listAnswers); } list.Add(show); } return(list); }