/// <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 MetaColorSelectedItemResponse SelectedItem([FromBody] MetaColorSelectedItemRequest request) { MetaColorSelectedItemResponse response = new MetaColorSelectedItemResponse(); if (request == null) { response.Status = 1; return(response); } if (request.ColorId <= 0) { response.Status = 1; return(response); } response.Item = metaColorProvider.ToMetadata(request.ColorId); response.Status = 1; return(response); }