コード例 #1
0
        // GET: Employees
        public async Task <IActionResult> Index()
        {
            var employees = await _repository.GetAllEmployeesAsync();

            foreach (var employee in employees)
            {
                employee.BenefitCostPerYear = await _discountRepository.GetTotalBenefitCost(employee.EmployeeId, employee.FirstName, employee.LastName, employee.Dependents);
            }

            return(View(employees));
        }
コード例 #2
0
 public async Task <ActionResult <IEnumerable <EmployeeViewModel> > > GetEmployees()
 {
     return(await _repository.GetAllEmployeesAsync());
 }