// GET: Properties/DetailsWithPhotoInfo/5 public ActionResult DetailsWithPhotoInfo(int?id) { // Attempt to get the matching object var o = m.PropertyGetByIdWithPhotoInfo(id.GetValueOrDefault()); if (o == null) { return(HttpNotFound()); } else { // Pass the object to the view return(View(o)); } }