public ActionResult AddAttraction(AttractionsViewModel attraction) { try { service.AddAttraction(AttractionsViewModel.AttractionsFromViewToDto(attraction)); } catch (ValidationException ex) { ModelState.AddModelError(ex.Property, ex.Message); } return(RedirectToAction("Attractions")); }
public IActionResult AddAttraction(Attractions attraction) { attractionsDatabase.AddAttraction(attraction); return(View("List", attractionsDatabase.GetAllAttractions())); }