Beispiel #1
0
        public static List <MyProduct> GetMyProductsWithNRecentReviews(int howManyReviews)
        {
            MyProductContext data     = new MyProductContext();
            List <MyProduct> products = data.Products;

            return(products.Where(p => p.ProductReviews.Count == howManyReviews).ToList());
        }
Beispiel #2
0
        public static List <MyProduct> GetProductsByVendorName(string vendorName)
        {
            MyProductContext data = new MyProductContext();

            return(data.Products.Where(p => p.ProductVendors.Any(pv => pv.Vendor.Name == vendorName)).ToList());
        }
Beispiel #3
0
        public static List <MyProduct> GetMyProductsByName(string namePart)
        {
            MyProductContext data = new MyProductContext();

            return(data.Products.Where(p => p.Name.Contains(namePart)).ToList());
        }