public ActionResult Display(int id) { Photo photo = context.FindPhotoById(id); if (photo == null) { return(HttpNotFound()); } return(View("Display", photo)); }
public ActionResult Display(int id) { Photo p = context.FindPhotoById(id); if (p != null) { return(View("Display", p)); } else { return(HttpNotFound()); } }
public ActionResult Detail(int id) { Photo photo = context.FindPhotoById(id); if (photo == null) { return(HttpNotFound()); } else { return(View("Detail", photo)); } }
public Photo GetPhotoById(int id) { Photo photo = context.FindPhotoById(id); if (photo == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } return(photo); }