예제 #1
0
        /// <summary>
        /// 套餐模板推荐商品映射
        /// </summary>
        /// <param name="packRecommendedSku">套餐模板推荐商品领域模型</param>
        /// <param name="productSkuInfo">推荐商品信息</param>
        /// <param name="decorationPackSpaces">空间集</param>
        /// <returns>套餐模板推荐商品数据传输对象</returns>
        public static App_DecorationPackSkuInfo ToAppDTO(this DecorationPackRecommendedSku packRecommendedSku, ProductSkuInfo productSkuInfo, List <DecorationPackSpace> decorationPackSpaces)
        {
            App_DecorationPackSkuInfo packSkuInfo = Transform <DecorationPackRecommendedSku, App_DecorationPackSkuInfo> .Map(packRecommendedSku);

            packSkuInfo.PackItemName = packRecommendedSku.PackRecommendedItem.Name;
            packSkuInfo.SpaceName    = decorationPackSpaces.Single(s => s.Id == packRecommendedSku.PackRecommendedItem.PackSpaceId).Name;
            packSkuInfo.SpaceId      = packRecommendedSku.PackRecommendedItem.PackSpaceId;
            packSkuInfo.Sort         = decorationPackSpaces.Single(s => s.Id == packRecommendedSku.PackRecommendedItem.PackSpaceId).Sort;
            packSkuInfo.Name         = productSkuInfo.Name;
            packSkuInfo.ProductType  = productSkuInfo.ProductType;
            packSkuInfo.Brand        = productSkuInfo.BrandName;
            packSkuInfo.Category     = productSkuInfo.CategoryName;
            return(packSkuInfo);
        }
예제 #2
0
        /// <summary>
        /// 套餐模板推荐商品映射
        /// </summary>
        /// <param name="sku">套餐模板推荐商品领域模型</param>
        /// <returns>套餐模板推荐商品数据传输对象</returns>
        public static DecorationPackRecommendedSkuInfo ToDTO(this DecorationPackRecommendedSku sku)
        {
            DecorationPackRecommendedSkuInfo packItemInfo = Transform <DecorationPackRecommendedSku, DecorationPackRecommendedSkuInfo> .Map(sku);

            return(packItemInfo);
        }