예제 #1
0
        // GET: api/Cliente/5
        public IHttpActionResult Get(int id)
        {
            try
            {
                ClienteRepo clienteRepo = new ClienteRepo();
                var         cliente     = clienteRepo.PesquisarPorId(id);

                if (cliente != null)
                {
                    return(Ok(cliente));
                }
                else
                {
                    return(StatusCode(HttpStatusCode.NoContent));
                }
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }