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