public async Task <List <EmployeeModel> > GetAllEmployees <T>()
        {
            List <EmployeeModel> employees = await _employeeClient.GetEmployees <EmployeeModel>();

            if (employees.Count() > default(int))
            {
                foreach (var item in employees)
                {
                    ISalaryFactory salaryFactoryObject = SalaryFactory.SalaryFactoryCreator((EContractType)Enum.Parse(typeof(EContractType), item.ContractTypeName, true), item.HourlySalary, item.MonthlySalary);
                    item.AnnualSalary = salaryFactoryObject.GetAnnualSalary();
                }
            }
            return(employees);
        }
        public async Task <List <Employee> > GetEmployeesAsync(int skip = 0, int limit = 25)
        {
            var normalizedLimit = 0;

            if (limit <= 0)
            {
                normalizedLimit = _appSettings.DefaultPageSize;
            }
            else
            {
                normalizedLimit = limit;
            }
            Log.Information("Business ==> GetEmployeeAsync");

            return(await _employeeClient.GetEmployees());
        }
Beispiel #3
0
        public List <EmployeeView> GetAllEmployees()
        {
            var employees = _employeeClient.GetEmployees();

            if (employees is null || !employees.Any())
            {
                return(new List <EmployeeView>());
            }

            var result = new List <EmployeeView>();

            employees.ForEach(c =>
            {
                result.Add(_employeeMapper.ToView(c, new EmployeeView()));
            });

            return(result);
        }