private async void GetCompanies() { IEnumerable <Employee> companies = await _bonusRepo.GetEmployeeWithCompany(0); foreach (Employee company in companies) { _employees.Add(company); } }
public async Task <IActionResult> Index(int companyId = 0) { //List<Employee> employees = _empRepo.GetAll(); //foreach(Employee obj in employees) //{ // obj.Company = _compRepo.Find(obj.CompanyId); //} List <Employee> employees = _bonRepo.GetEmployeeWithCompany(companyId); return(View(employees)); }
// public IActionResult Index(int companyId = 0) { /* List<Employee> employees = _empRepo.GetAll(); * foreach(Employee obj in employees) * { * obj.Company = _compRepo.Find(obj.CompanyId); * } */ // 1 //return View(_empRepo.GetAll()); // 2 List <Employee> employees = _bonRepo.GetEmployeeWithCompany(companyId); return(View(employees)); }
public async Task <IActionResult> Index() { List <Employee> employees = _bonRepo.GetEmployeeWithCompany(); return(View(employees)); }