Beispiel #1
0
 public IActionResult AddDestination([FromBody] NewDestinationVm destVm)
 {
     if (!ModelState.IsValid || destVm.Id != 0)
     {
         return(Conflict(ModelState));
     }
     _destService.AddDestination(destVm);
     return(Ok());
 }
        public IActionResult AddDestination(NewDestinationVm destVm)
        {
            if (!ModelState.IsValid)
            {
                destVm.Countries = _destService.GetCountries().ToList();
                return(PartialView(destVm));
            }
            var id = _destService.AddDestination(destVm);

            _logger.LogInformation("New destination has been added - " + id);
            return(RedirectToAction("Index"));
        }