MySql.Data.Entity.Tests.AggregateOperators.MaxInSubQuery2 C# (CSharp) Method

MaxInSubQuery2() private method

private MaxInSubQuery2 ( ) : void
return void
        public void MaxInSubQuery2()
        {
            MySqlDataAdapter da = new MySqlDataAdapter(
                "SELECT s.* FROM Stores AS s WHERE s.id=(SELECT MAX(o.storeId) FROM Orders AS o)", conn);
            DataTable dt = new DataTable();
            da.Fill(dt);

            using (testEntities context = new testEntities())
            {
                string sql = @"SELECT VALUE s FROM Stores AS s WHERE s.Id = 
                                ANYELEMENT(SELECT VALUE MAX(o.Store.Id) FROM Orders As o)";
                ObjectQuery<Store> q = context.CreateQuery<Store>(sql);

                int i = 0;
                foreach (Store s in q)
                    Assert.AreEqual(dt.Rows[i++]["id"], s.Id);
            }
        }
    }