/// <summary> /// 套餐模板项映射 /// </summary> /// <param name="packItem">套餐模板项领域模型</param> /// <param name="decorationPackInfos">套餐模板字典</param> /// <returns>套餐模板项数据传输对象</returns> public static DecorationPackItemInfo ToDTO(this DecorationPackItem packItem) { DecorationPackItemInfo packItemInfo = Transform <DecorationPackItem, DecorationPackItemInfo> .Map(packItem); //packItemInfo.DecorationPackInfo = decorationPackInfos == null ? null : decorationPackInfos[packItem.PackId]; return(packItemInfo); }
/// <summary> /// 套餐模板项映射 /// </summary> /// <param name="packItem">套餐模板项领域模型</param> /// <param name="packs">套餐模板字典</param> /// <returns>套餐模板项数据传输对象</returns> public static DecorationPackItemInfo ToDTO(this DecorationPackItem packItem, IDictionary <Guid, DecorationPack> packs) { DecorationPackItemInfo packItemInfo = Transform <DecorationPackItem, DecorationPackItemInfo> .Map(packItem); DecorationPack pack = packs[packItem.PackId]; packItemInfo.DecorationPackInfo = pack.ToDTO(new List <DecorationPackScheme>()); packItemInfo.PackSpaceName = pack.Spaces.Single(x => x.Id == packItem.PackSpaceId).Name; return(packItemInfo); }