public void MinWithPredicate()
{
MySqlCommand trueCmd = new MySqlCommand("SELECT MIN(Freight) FROM Orders WHERE storeId=2", conn);
object freight = trueCmd.ExecuteScalar();
using (testEntities context = new testEntities())
{
string sql = "SELECT Min(o.Freight) FROM Orders AS o WHERE o.Store.Id = 2";
ObjectQuery<DbDataRecord> q = context.CreateQuery<DbDataRecord>(sql);
foreach (DbDataRecord r in q)
{
Assert.AreEqual(freight, r.GetDouble(0));
}
}
}