Пример #1
0
        public PayorController(IPayorService payorService)
        {
            _payorService = payorService;

            Mapper.CreateMap<PayorDTO, Payor>();
            Mapper.CreateMap<Payor, PayorDTO>();
            Mapper.CreateMap<List<Payor>, List<PayorDTO>>();
        }
Пример #2
0
        public PayorController(IPayorService payorService)
        {
            _payorService = payorService;

            Mapper.CreateMap <PayorDTO, Payor>();
            Mapper.CreateMap <Payor, PayorDTO>();
            Mapper.CreateMap <List <Payor>, List <PayorDTO> >();
        }
Пример #3
0
        public EmployeeController(IPayorService payorService, IEmployeeService employeeService)
        {
            _payorService    = payorService;
            _employeeService = employeeService;

            Mapper.CreateMap <EmployeeDTO, Employee>()
            .AfterMap(
                (src, dest) => dest.Payors = _payorService.FindBy(t => t.Id == src.PayorId)
                );
            Mapper.CreateMap <Employee, EmployeeDTO>()
            .AfterMap(
                (src, dest) => dest.PayorId = src.Payors.Id
                );

            Mapper.CreateMap <List <Employee>, List <EmployeeDTO> >();
        }
Пример #4
0
        public EmployeeController(IPayorService payorService, IEmployeeService employeeService)
        {
            _payorService = payorService;
            _employeeService = employeeService;

            Mapper.CreateMap<EmployeeDTO, Employee>()
               .AfterMap(
                   (src, dest) => dest.Payors = _payorService.FindBy(t => t.Id == src.PayorId)
               );
            Mapper.CreateMap<Employee, EmployeeDTO>()
                .AfterMap(
                    (src, dest) => dest.PayorId = src.Payors.Id
                );

            Mapper.CreateMap<List<Employee>, List<EmployeeDTO>>();
        }
Пример #5
0
        public UserController(IPayorService payorService, IUserService userService)
        {
            _payorService = payorService;
            _userService  = userService;

            Mapper.CreateMap <UserDTO, User>()
            .AfterMap(
                (src, dest) => dest.Payor = _payorService.FindBy(t => t.Id == src.PayorId)
                );
            Mapper.CreateMap <UserInputDTO, User>()
            .AfterMap(
                (src, dest) => dest.Payor = _payorService.FindBy(t => t.Id == src.PayorId)
                );
            Mapper.CreateMap <User, UserDTO>()
            .AfterMap(
                (src, dest) => dest.PayorId = src.Payor.Id
                );

            Mapper.CreateMap <List <User>, List <UserDTO> >();
        }
Пример #6
0
        public UserController(IPayorService payorService, IUserService userService)
        {
            _payorService = payorService;
            _userService = userService;

            Mapper.CreateMap<UserDTO, User>()
               .AfterMap(
                   (src, dest) => dest.Payor = _payorService.FindBy(t => t.Id == src.PayorId)
               );
            Mapper.CreateMap<UserInputDTO, User>()
             .AfterMap(
                 (src, dest) => dest.Payor = _payorService.FindBy(t => t.Id == src.PayorId)
             );
            Mapper.CreateMap<User, UserDTO>()
                .AfterMap(
                    (src, dest) => dest.PayorId = src.Payor.Id
                );

            Mapper.CreateMap<List<User>, List<UserDTO>>();
        }