Catbert4.Controllers.SchoolController.Delete C# (CSharp) Метод

Delete() публичный Метод

public Delete ( string id ) : System.Web.Mvc.ActionResult
id string
Результат System.Web.Mvc.ActionResult
        public ActionResult Delete(string id)
        {
            var school = _schoolRepository.GetNullableById(id);

            if (school == null) return RedirectToAction("Index");

            //Can't delete school if any units are assocaited with it
            if (_unitRepository.Queryable.Any(x => x.School.Id == id))
            {
                Message = string.Format("Can't remove {0} ({1}) because there are units associated with it", school.ShortDescription, school.Id);
                return RedirectToAction("Index");
            }

            return View(school);
        }

Same methods

SchoolController::Delete ( string id, School school ) : System.Web.Mvc.ActionResult