Esempio n. 1
0
 public IActionResult Incluir([FromBody] ContaApi model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             var conta = _contaService.CriarConta(model);
             return(Created($"contas/{model.Idenfifier}", conta.ToApi()));
         }
         catch (Exception ex)
         {
             return(BadRequest(ex.Message));
         }
     }
     return(BadRequest());
 }