// GET: People/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Person person = repo.FindPersonById(id); if (person == null) { return(HttpNotFound()); } return(View(person)); }
public IHttpActionResult GetPerson(int id) { Person person = _repo.FindPersonById(id); if (person == null) { return(NotFound()); } return(Ok(person)); }