public ActionResult DeleteEvaluation(Guid evaluationId) { var deletedEvalauation = Evaluations.DeleteEvaluation(evaluationId); if (ReferenceEquals(deletedEvalauation.GetType(), typeof(ErrorDomainModel))) { return(GradeTrackerError(deletedEvalauation, null)); } else { var castedDomainModel = (EvaluationDomainModel)deletedEvalauation; var courseIdOnlyModel = new EvaluationViewModel { CourseId = castedDomainModel.CourseId }; Courses.EvaluationModified(courseIdOnlyModel.CourseId); return(View("EvaluationDeleted", courseIdOnlyModel)); } }