示例#1
0
        private IList <ProductRelationship> WrapRelateds(Product product, IEnumerable <Product> products)
        {
            List <ProductRelationship> relationships = new List <ProductRelationship>();

            foreach (Product p in products)
            {
                ProductRelationship relationship = new ProductRelationship(p);
                relationship.IsRelated = product.Products_Relateds1.
                                         Where <Products_Related>(r => r.RelatedSKU == p.SKU).Count() > 0;
                relationships.Add(relationship);
            }
            return(relationships);
        }
 private IList<ProductRelationship> WrapRelateds(Product product, IEnumerable<Product> products)
 {
     List<ProductRelationship> relationships = new List<ProductRelationship>();
     foreach (Product p in products)
     {
         ProductRelationship relationship = new ProductRelationship(p);
         relationship.IsRelated = product.Products_Relateds1.
                 Where<Products_Related>(r => r.RelatedSKU == p.SKU).Count() > 0;
         relationships.Add(relationship);
     }
     return relationships;
 }