public async Task <bool> RestoreTestQuestion(int id) { var question = await testQuestionRepository.RestoreQuestion(id); if (question == null) { return(false); } var test = await testRepository.GetTest(question.TestId); if (test.AutomaticTime == true) { test.TimeOfTest += (int)question.Complexity; } question.isDelete = false; answersRepository.SetValueIsNotDeleteOnQuestion(question.NumberOfIdentification); testQuestionRepository.Update(question); await testQuestionRepository.SaveChangesAsync(); return(true); }