public ActionResult Create(PropertyViewModel propertyViewModel) { try { Property property = PropertyMapper.ToProperty(propertyViewModel); _propertyBusiness.AddProperty(property); return(RedirectToAction(nameof(Index))); } catch (Exception ex) { throw ex; //return View(); } }
public ActionResult Create(PropertyViewModel propertyViewModel) { try { if (ModelState.IsValid) { Property property = PropertyMapper.ToProperty(propertyViewModel); _propertyBusiness.AddProperty(property); return(RedirectToAction(nameof(Index))); } else { return(View()); } } catch { return(View()); } }