public ActionResult Edit(int?id) { DbLocation location = GetLocationIfExistsAndUserHasAccess(id); if (location == null) { return(RedirectToAction("Index")); } ViewBag.Location = location; ViewBag.LocationId = location.Id; LocationEditViewModel locationModel = location.ToLocationEditValidationModel(); return(View(locationModel)); }