Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="source"></param>
        /// <param name="brandInfo"></param>
        /// <param name="storeInfo"></param>
        /// <param name="showCustomerInfo"></param>
        /// <param name="tagInfoResponse"></param>
        /// <param name="resourceInfoResponses"></param>
        /// <param name="promotions"></param>
        /// <returns></returns>
        public ProductInfoResponse ProductInfoResponseMapping(ProductEntity source, BrandInfoResponse brandInfo,
                                                                     StoreInfoResponse storeInfo,
                                                                     ShowCustomerInfoResponse showCustomerInfo,
                                                                     TagInfoResponse tagInfoResponse, List<ResourceInfoResponse> resourceInfoResponses, List<PromotionInfo> promotions = null)
        {
            if (source == null)
            {
                return null;
            }

            var target = Mapper.Map<ProductEntity, ProductInfoResponse>(source);

            target.BrandInfoResponse = brandInfo;
            target.StoreInfoResponse = storeInfo;
            target.RecommendUserInfoResponse = showCustomerInfo;
            target.TagInfoResponse = tagInfoResponse;
            target.ResourceInfoResponses = resourceInfoResponses;
            target.Promotions = promotions;

            return target;
        }
Exemplo n.º 2
0
        public PromotionInfoResponse PromotionResponseMapping(PromotionEntity source, CoordinateInfo coordinateInfo, List<int> brandIds, List<ResourceInfoResponse> resourceInfoResponses, StoreInfoResponse storeInfoResponse, ShowCustomerInfoResponse showCustomerInfoResponse)
        {
            if (source == null)
            {
                return null;
            }

            var target = PromotionInfoResponseMapping(source);

            if (showCustomerInfoResponse != null)
            {
                target.ShowCustomer = showCustomerInfoResponse;
            }

            if (storeInfoResponse != null)
            {
                target.StoreInfoResponse = storeInfoResponse;
            }

            if (resourceInfoResponses != null)
            {
                target.ResourceInfoResponses = resourceInfoResponses;
            }

            if (brandIds != null)
            {
                target.BrandIds = brandIds;
            }

            return target;
        }