public void LinqToEntities13()
        {
            var query = from c in Session.Query.All <Customer>()
                        select new { c.CompanyName };

            QueryDumper.Dump(query);
        }
        public void LinqToEntities14()
        {
            var query = from i in Session.Query.All <Invoice>()
                        select new { i };

            QueryDumper.Dump(query);
        }
        public void LinqToEntities11()
        {
            var query = from c in Session.Query.All <Customer>()
                        select c;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities45()
        {
            Require.ProviderIsNot(StorageProvider.SqlServerCe);
            var query = Session.Query.All <Track>().Select(i => i.MediaType).Distinct();

            QueryDumper.Dump(query);
        }
        public void LinqToEntities75()
        {
            Require.ProviderIsNot(StorageProvider.SqlServerCe);
            var query = Session.Query.All <Customer>().Where(cust => cust.Invoices.Any(i => i.BillingAddress == cust.Address)).Select(c2 => c2);

            QueryDumper.Dump(query);
        }
        public void LinqToEntities25()
        {
            var query = Session.Query.All <Invoice>()
                        .Where(i => i.BillingAddress.Country == "Mexico").Count();

            QueryDumper.Dump(query);
        }
        public void LinqToEntities22()
        {
            var query = Session.Query.All <Customer>().Where(cust => cust.Address.Country == "Denmark")
                        .SelectMany(cust => cust.Invoices.Where(i => i.Commission > 0.05m));

            QueryDumper.Dump(query);
        }
        public void LinqToEntities15()
        {
            var query = from i in Session.Query.All <Invoice>()
                        select new { i, i.DesignatedEmployee };

            QueryDumper.Dump(query);
        }
        public void LinqToEntities56()
        {
            var query = Session.Query.All <Track>().OrderBy(p => p.Milliseconds)
                        .Select(p2 => new { p2.TrackId });

            QueryDumper.Dump(query);
        }
        public void LinqToEntities17()
        {
            var query = Session.Query.All <Customer>().Where(cust => cust.CustomerId == 4200)
                        .SelectMany(cust => cust.Invoices);

            QueryDumper.Dump(query);
        }
        public void LinqToEntities72()
        {
            var query = from e in Session.Query.All <Employee>()
                        select new { e, orders = e.Invoices.Select(i => i) };

            QueryDumper.Dump(query);
        }
        public void LinqToEntities91()
        {
            MyClass c     = new MyClass();
            var     query = Session.Query.All <Invoice>().Where(i => i.Commission > MyClass.Val).Select(i => new { i.Commission, i });

            QueryDumper.Dump(query);
        }
        public void LinqToEntities3()
        {
            var query = from t in Session.Query.All <Track>()
                        where t.Milliseconds < 180000 && t.Genre.GenreId == 282
                        select t;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities4()
        {
            var query = from p in Session.Query.All <Track>()
                        where p.UnitPrice < 1
                        select p;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities5()
        {
            var query = from i in Session.Query.All <Invoice>()
                        where i.Customer.Address.Country == "Mexico"
                        select i;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities73()
        {
            Require.ProviderIsNot(StorageProvider.SqlServerCe | StorageProvider.Oracle);
            var query = Session.Query.All <Customer>().Where(cust => cust.CustomerId == 4233)
                        .Select(c => c.Invoices.Sum(i => i.Commission));

            QueryDumper.Dump(query);
        }
        public void LinqToEntities1()
        {
            var query = from cust in Session.Query.All <Customer>()
                        where cust.Address.City == "Seattle"
                        select cust;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities7()
        {
            var query = from e in Session.Query.All <Employee>()
                        where e.Invoices.Any(i => i != null)
                        select e;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities6()
        {
            var query = from i in Session.Query.All <Invoice>()
                        where i.DesignatedEmployee.Address.Country == "UK"
                        select i;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities62()
        {
            var query = from p in Session.Query.All <Track>()
                        orderby p.UnitPrice descending
                        select p;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities55()
        {
            var query = from p in Session.Query.All <Track>()
                        orderby p.Milliseconds
                        select new { p.TrackId };

            QueryDumper.Dump(query);
        }
        public void LinqToEntities57()
        {
            var query = from c in Session.Query.All <Customer>()
                        orderby c.Address.State descending
                        select c;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities54()
        {
            var query = from c in Session.Query.All <Customer>()
                        orderby c.CompanyName descending
                        select c;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities46()
        {
            var mexico = Session.Query.All <Invoice>().Where(i => i.BillingAddress.Country == "Mexico").Select(i => i);
            var canada = Session.Query.All <Invoice>().Where(i => i.BillingAddress.Country == "Canada").Select(i => i);
            var query  = mexico.Union(canada);

            QueryDumper.Dump(query);
        }
        public void LinqToEntities16()
        {
            var query = from c in Session.Query.All <Customer>()
                        where c.CustomerId == 4200
                        from i in c.Invoices
                        select i;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities66()
        {
            var query = from c in Session.Query.All <Customer>()
                        group c by c.Address.State
                        into states
                        select new { State = states.Key, Count = states.Count() };

            QueryDumper.Dump(query);
        }
        public void LinqToEntities65()
        {
            var query = from i in Session.Query.All <Invoice>()
                        group i by i.InvoiceDate
                        into dates
                        select new { dates.Key };

            QueryDumper.Dump(query);
        }
        public void LinqToEntities18()
        {
            var query = from c in Session.Query.All <Customer>()
                        where c.Address.Country == "Denmark"
                        from i in c.Invoices
                        select i;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities2()
        {
            DateTime dt    = new DateTime(2005, 1, 1);
            var      query = from invoice in Session.Query.All <Invoice>()
                             where invoice.InvoiceDate > dt
                             select invoice;

            QueryDumper.Dump(query);
        }
        public void LinqToEntities10()
        {
            Require.ProviderIsNot(StorageProvider.Oracle);
            var query = from e in Session.Query.All <Employee>()
                        where e.Invoices.All(i => i.Customer.Address.Country != "Canada")
                        select e;

            QueryDumper.Dump(query);
        }