public async Task <QuizResponse> AddQuizMarks(QuizMarks[] quizMarks) { try { using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { await _quizRepository.AddQuizMarks(quizMarks); await _unitOfWork.CompleteAsync(); scope.Complete(); } return(new QuizResponse()); } catch (Exception ex) { // Do some logging stuff return(new QuizResponse($"An error occurred when saving the quizMarks: {ex.Message}")); } }