Пример #1
0
        public AdminProfileViewModel GetEmployeeByID(int EmployeeID)
        {
            Employee employee = er.GetEmployeeByID(EmployeeID);
            AdminProfileViewModel adminProfileView = null;
            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <Employee, AdminProfileViewModel>();
                cfg.CreateMap <Department, DepartmentViewModel>();

                cfg.IgnoreUnmapped();
            });
            IMapper mapper = config.CreateMapper();

            adminProfileView = mapper.Map <Employee, AdminProfileViewModel>(employee);

            return(adminProfileView);
        }
Пример #2
0
        public EmployeeDTO GetEmployeeByID(int id)
        {
            EmployeeDTO employee = _repo.GetEmployeeByID(id);

            return(employee);
        }