// GET: Property/Details/5 public ActionResult Details(int?id) { if (id == null) { return(RedirectToAction("Listing")); //return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Property property = propertyMapper.SelectPropertyById(id); if (property == null) { return(HttpNotFound()); } // Increment ClickCount propertyMapper.IncrementCountClickedForPropertyID(id); return(View(property)); }