public CityController(CitiesRepository cities) { _cities = cities; // Create a new CityItem if collection is empty, // which means you can't delete all TodoItems. _cities.Add(new City("Item1", "Bone")); }
public IActionResult Create(City city) { _cities.Add(city); return(CreatedAtRoute("GetCity", new City(city))); }
public IActionResult NewCity(City ct) { CitiesRepository.Add(ct); return(Ok(ct)); }