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