public ActionResult Delete(long?parentId, long id) { var assignmentGroup = _assignmentGroupRepository.GetById(id); if (!_assignmentGroupService.IsDeactivable(assignmentGroup)) { ModelState.AddModelError("AssignmentGroup", _localizationService.GetResource("Common.NotDeactivable")); } if (ModelState.IsValid) { //soft delete _assignmentGroupRepository.DeactivateAndCommit(assignmentGroup); //notification SuccessNotification(_localizationService.GetResource("Record.Deleted")); return(new NullJsonResult()); } else { return(Json(new { Errors = ModelState.SerializeErrors() })); } }