Beispiel #1
0
        public IActionResult Put(string cityName, [FromBody] CityViewModel city)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            _citiesRepository.EditCity(city);
            return(Ok());
        }
Beispiel #2
0
        public IActionResult Put(string cityName, [FromBody] CityViewModel cityViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var city = new City();

            city.InjectFrom(cityViewModel);

            _citiesRepository.EditCity(city);

            return(Ok());
        }