using System.Linq;
using Microsoft.EntityFrameworkCore;
using QueryingDemo.Model;

namespace QueryingDemo.Samples
{
    public class Sample4 : ISample
    {
        public int Number => 4;
        public string Title => "SELECT with EXISTS";
        public void Run(NorthwindContext dc)
        {
            var result = dc.Products
                .Where(p => p.OrderDetails.Any(d => d.Quantity > 10))
                .ToList();
        }
    }
}