public IActionResult Put(int id, ClienteModel cliente)
        {
            ClienteBO    clienteBO;
            ObjectResult response;

            try
            {
                _log.LogInformation($"Starting Put( {id}, '{JsonConvert.SerializeObject(cliente, Formatting.None)}')");

                clienteBO = new ClienteBO(_loggerFactory, _config);

                cliente.ID = id;
                cliente    = clienteBO.Update(cliente);

                response = Ok(cliente);

                _log.LogInformation($"Finishing Put( {id} )");
            }
            catch (Exception ex)
            {
                _log.LogError(ex.Message);
                response = StatusCode(500, ex.Message);
            }

            return(response);
        }
Esempio n. 2
0
 public bool Update(ClienteDTO cliente)
 {
     try
     {
         if (Global.TpConexao == Enumeradores.TipoConexao.LAN)
         {
             return(regrasnegocio.Update(cliente));
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         throw;
     }
 }