예제 #1
0
        private async Task <HttpResponseMessage> RetornaDadosApi(int id = 0)
        {
            try
            {
                FuncionarioAPI api    = new FuncionarioAPI();
                HttpClient     client = api.ServicoFuncioanrio();

                if (id == 0 || id == null)
                {
                    HttpResponseMessage res = await client.GetAsync("Funcionario");

                    return(res);
                }
                else
                {
                    HttpResponseMessage res = await client.GetAsync($"Funcionario/{id}");

                    return(res);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }