Пример #1
0
        public ActionResult AddAttraction(AttractionsViewModel attraction)
        {
            try
            {
                service.AddAttraction(AttractionsViewModel.AttractionsFromViewToDto(attraction));
            }
            catch (ValidationException ex)
            {
                ModelState.AddModelError(ex.Property, ex.Message);
            }

            return(RedirectToAction("Attractions"));
        }
Пример #2
0
 public IActionResult AddAttraction(Attractions attraction)
 {
     attractionsDatabase.AddAttraction(attraction);
     return(View("List", attractionsDatabase.GetAllAttractions()));
 }