public async Task <HttpResponseMessage> GetAll(string cnpj) { HttpResponseMessage response = new HttpResponseMessage(); try { List <Veiculo> veiculos = await VeiculoDAO.GetAllAsync(cnpj); response.Content = new ObjectContent(typeof(List <Veiculo>), veiculos, JsonConfig.DefaultJsonMediaType); response.StatusCode = HttpStatusCode.OK; } catch (Exception ex) { response.Content = new ObjectContent(typeof(Exception), ex, JsonConfig.DefaultJsonMediaType); response.StatusCode = HttpStatusCode.InternalServerError; } ApiLog(response.StatusCode); return(response); }