Exemplo n.º 1
0
 public async Task <ActionResult> Create([FromBody] CityRequest request)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(BadRequest(ModelState));
         }
         return(Ok(await _cityService.Create(request)));
     }
     catch (Exception ex)
     {
         return(BadRequest());
     }
 }
Exemplo n.º 2
0
 public void Create(CityModel cityModel)
 {
     _service.Create(cityModel);
 }