public ActionResult AddPhoto(int?id) { // Attempt to get the matching object var o = m.PropertyGetById(id.GetValueOrDefault()); if (o == null) { return(HttpNotFound()); } else { // Create a form var form = new PhotoAddForm(); // Configure its property values form.PropertyId = o.Id; form.PropertyInfo = $"{o.Address}, {o.City}<br>Asking price ${o.Price}"; // Pass the object to the view return(View(form)); } }
public ActionResult AddPhoto(int? id) { // Attempt to get the matching object var o = m.PropertyGetById(id.GetValueOrDefault()); if (o == null) { return HttpNotFound(); } else { // Create a form var form = new PhotoAddForm(); // Configure its property values form.PropertyId = o.Id; form.PropertyInfo = $"{o.Address}, {o.City}<br>Asking price ${o.Price}"; // Pass the object to the view return View(form); } }