public IActionResult Post([FromBody] ClienteModel cliente) { ClienteBO clienteBO; ObjectResult response; try { _log.LogInformation($"Starting Post('{JsonConvert.SerializeObject(cliente, Formatting.None)}')"); clienteBO = new ClienteBO(_loggerFactory, _config); cliente = clienteBO.Insert(cliente); response = Ok(cliente); _log.LogInformation($"Finishing Post"); } catch (Exception ex) { _log.LogError(ex.Message); response = StatusCode(500, ex.Message); } return(response); }
public int Insert(ClienteDTO cliente) { try { if (Global.TpConexao == Enumeradores.TipoConexao.LAN) { return(regrasnegocio.Insert(cliente)); } else { return(0); } } catch { throw; } }