public IEnumerable <ProductViewModel> GetMappedProducts(Guid clientId)
        {
            IClient client = clientRepository.Get(clientId);

            IEnumerable <IProduct> products = productRepository.GetClientProducts(client);

            IProductMapper productMapper = mapperFactory.CreateMapper <IProductMapper, IProduct>(products);

            IEnumerable <IProduct> processedProducts = productMapper.ApplyTVA(products);

            IProductViewModelMapper viewModelMapper = mapperFactory.CreateMapper <IProductViewModelMapper, IProduct>(processedProducts);

            IEnumerable <ProductViewModel> viewModel = viewModelMapper.MapToViewModel(processedProducts);

            return(viewModel);
        }
Пример #2
0
        public RealtorService(IUnitOfWork unitOfWork, IMapperFactory mapperFactory, IRealeEstateSort realeEstateSort)
        {
            _unitOfWork      = unitOfWork;
            _mapper          = mapperFactory.CreateMapper();
            _realeEstateSort = realeEstateSort;
            var cityKiev = _unitOfWork.Cities.GetAll().FirstOrDefault(x => x.Name == "Киев");

            if (cityKiev != null)
            {
                _cityKievId = cityKiev.Id;
            }
            else
            {
                throw new HttpException(404, "Cannot find Kiev. Working just for area of Kiev city.");
            }
        }
Пример #3
0
 public CartItemService(IUnitOfWork unitOfWork, IMapperFactory factory) : base(unitOfWork)
 {
     _mapper = factory.CreateMapper();
 }
Пример #4
0
 public DoctorService(IUnitOfWork unitOfWork, IMapperFactory mapperFactory)
 {
     _unitOfWork   = unitOfWork;
     _doctorMapper = mapperFactory.CreateMapper <CommonProfile>().Mapper;
 }
Пример #5
0
 public CommentService(IUnitOfWork unitOfWork, IMapperFactory mapperFactory)
 {
     _unitOfWork    = unitOfWork;
     _commentMapper = mapperFactory.CreateMapper <CommonProfile>().Mapper;
 }
Пример #6
0
 public CategoryService(IUnitOfWork uow, IMapperFactory factory) : base(uow)
 {
     _mapper = factory.CreateMapper();
 }
 public SkillService(IUnitOfWork <SubSkill, Skill, Level, KnowledgeManagement.DAL.SpecifyingSkill.Entities.SpecifyingSkill> unitOfWork, IMapperFactory mapperFactory)
 {
     _unitOfWork = unitOfWork;
     _mapper     = mapperFactory.CreateMapper();
 }
Пример #8
0
 public AnalyzeService(IUnitOfWork unitOfWork, IMapperFactory mapperFactory)
 {
     _unitOfWork    = unitOfWork;
     _analyzeMapper = mapperFactory.CreateMapper <CommonProfile>().Mapper;
 }
Пример #9
0
 public IdentityService(IIdentityUnitOfWork <ApplicationUserManager, ApplicationRoleManager> uow, IMapperFactory mapperFactory)
 {
     _unitOfWork = uow;
     _mapper     = mapperFactory.CreateMapper();
 }
Пример #10
0
 public HospitalService(IUnitOfWork unitOfWork, IMapperFactory mapperFactory)
 {
     _unitOfWork     = unitOfWork;
     _hospitalMapper = mapperFactory.CreateMapper <CommonProfile>().Mapper;
 }