Exemplo n.º 1
0
        public IActionResult Create(City city)
        {
            try
            {
                services.CreateCity(city);
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                ViewBag.Msg = ex.Message;
            }

            return(View());
        }
Exemplo n.º 2
0
 // POST api/city
 public int Post([FromBody] CityEntity cityEntity)
 {
     return(_cityServices.CreateCity(cityEntity));
 }