/// <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); }
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); }