var names = new[] { "Tom", "Dick", "Harry", "Mary", "Jay" }.AsQueryable();
var query =
from n in names
where n.Length > 3
let u = n.ToUpper() //引入新的变量同时保留原来的
where u.EndsWith ("Y") && n.StartsWith("M")
select u;
var query =
from n in names
where n.Length > 3
let u = n.ToUpper() //引入新的变量同时保留原来的
where u.EndsWith ("Y") && n.StartsWith("M")
select u;
names.Where ((n, i) => i % 2 == 0).Dump ("Skipping every second element");
from n in names
where n.Length == names.Min (n2 => n2.Length)
select n
where n.Length == names.Min (n2 => n2.Length)
select n
from c in Customers
where c.Purchases.Any (p => p.Price > 1000)
select c
where c.Purchases.Any (p => p.Price > 1000)
select c
from c in Customers
let highValuePurchases = c.Purchases.Where (p => p.Price > 1000)
where highValuePurchases.Any()
select new
{
c.Name,
highValuePurchases
}
let highValuePurchases = c.Purchases.Where (p => p.Price > 1000)
where highValuePurchases.Any()
select new
{
c.Name,
highValuePurchases
}