Пример #1
0
        /// <summary>
        /// 将entity转换为vo
        /// </summary>
        public TheBookExtendedVo toExtendedVo(TheBookEntity entity)
        {
            TheBookExtendedVo vo = new TheBookExtendedVo();

            CopyToVo(vo, entity);
            if (!string.IsNullOrEmpty(entity.CategoryIds))
            {
                var items = entity.CategoryIds.Split(";").ToList();
                vo.CategoryIds = metaCategoryProvider.ToMetadataList(items);
            }
            vo.ColorId = metaColorProvider.ToMetadata(entity.ColorId);

            return(vo);
        }
Пример #2
0
        public List <TheBookExtendedVo> toExtendedVoList(List <TheBookEntity> entityList)
        {
            if (entityList == null)
            {
                return(null);
            }

            List <TheBookExtendedVo> voList = new List <TheBookExtendedVo>();

            foreach (TheBookEntity entity in entityList)
            {
                TheBookExtendedVo vo = toExtendedVo(entity);
                voList.Add(vo);
            }

            return(voList);
        }