public async Task <List <Employees> > getEmployees(int id) { ApiServices apiService = new ApiServices(); var url = "http://localhost:52868"; var prefix = "/api"; var controller = "/Employees"; var response = await apiService.GetList <Employees>(url, prefix, controller, id); if (response.IsSuccess) { Employees employePrueba = new Employees(); foreach (Employees employe in (List <Employees>)response.Result) { EmployeesFactory employeFactry = new EmployeesFactory(); EmployeesList.Add(employeFactry.GetEmployeesSalary(employe)); } } ; return(EmployeesList); }
public async Task <List <Employees> > LoadEmployees() { ApiServices apiService = new ApiServices(); var url = "http://masglobaltestapi.azurewebsites.net"; var prefix = "/api"; var controller = "/Employees"; var response = await apiService.GetList <Employees>(url, prefix, controller); if (response.IsSuccess) { Employees employePrueba = new Employees(); foreach (Employees employe in (List <Employees>)response.Result) { EmployeesFactory employeFactry = new EmployeesFactory(); EmployeesList.Add(employeFactry.GetEmployeesSalary(employe)); } } ; return(EmployeesList); }