示例#1
0
        public static CategoryShort ConvertToShortDTO(this BB.Core.Model.ProductCategory entity)
        {
            var result = new CategoryShort();

            result.ProductCategoryId = entity.ProductCategoryId;
            result.Name           = entity.Name;
            result.FacingImageURL = entity.FacingImage?.PictureUrl;
            result.Parent         = entity.ParentCategory?.ConvertToShortDTO();
            return(result);
        }
示例#2
0
        public static Category ConvertToDTO(this BB.Core.Model.ProductCategory entity)
        {
            var result = new Category();

            result.ProductCategoryId = entity.ProductCategoryId;
            result.Name           = entity.Name;
            result.FacingImageURL = entity.FacingImage.PictureUrl;
            foreach (var it in entity.ChildrenCategories)
            {
                result.Children.Add(it.ConvertToDTO());
            }

            return(result);
        }