public ActionResult Delete(Guid?id) { if (id.HasValue) { var addressId = (Guid)id; var address = _repository.Find(addressId); _repository.Remove(addressId, address.PersonId); } return(Redirect("~")); }
public ActionResult Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Address address = _addressRepository.Find(id.Value); if (address == null) { return(HttpNotFound()); } return(View(address)); }