Example #1
0
        public IActionResult CreateCity(int id, string name, string description)
        {
            Models.CityDto theCity = new Models.CityDto();
            theCity.Id          = id;
            theCity.Name        = name;
            theCity.Description = description;

            return(StatusCode(201, theCity));
        }
Example #2
0
 //[Produces("application/json")]
 public IActionResult GetCity(int id)
 {
     Models.CityDto city = CitiesDataStore.Current.Cities.FirstOrDefault(c => c.Id == id);
     if (city == null)
     {
         return(NotFound());
     }
     return(Ok(city));
 }