示例#1
0
        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"));
        }
示例#2
0
        public IActionResult Create(City city)
        {
            _cities.Add(city);

            return(CreatedAtRoute("GetCity", new City(city)));
        }
示例#3
0
 public IActionResult NewCity(City ct)
 {
     CitiesRepository.Add(ct);
     return(Ok(ct));
 }