public async Task <bool> DeleteTest(int id) { var test = await testRepository.GetTest(id); if (test == null) { return(false); } test.isDelete = true; testQuestionRepository.SetValueIsDeleteOnTest(id); answersRepository.SetValueIsDeleteOnTest(id); testRepository.Update(test); await testRepository.SaveChangesAsync(); return(true); }