예제 #1
0
        public EmployeeModel Execute(int id)
        {
            var databaseServiceBenefitsData = _getBenefitsDataQuery.Execute();

            var employee = _databaseService
                           .Employees
                           .Include("Dependents")
                           .SingleOrDefault(e => e.Id == id);

            return(EmployeeConverter
                   .CreateEmployeeModel(employee, databaseServiceBenefitsData));
        }
        List <EmployeeModel> IGetEmployeeListQuery.Execute()
        {
            var employees = _databaseService
                            .Employees
                            .Include("Dependents")
                            .ToList();

            var databaseServiceBenefitsData = _getBenefitsDataQuery.Execute();

            return(employees
                   .Select(employee => EmployeeConverter.CreateEmployeeModel(employee, databaseServiceBenefitsData))
                   .ToList());
        }