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

            _citiesRepository.EditCity(city);
            return(Ok());
        }
コード例 #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());
        }