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;
 
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
 
    from c in Customers
    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
}

相关文章:

  • 2022-12-23
  • 2021-04-22
  • 2021-11-20
  • 2021-07-11
  • 2021-09-06
  • 2021-10-31
  • 2021-09-14
猜你喜欢
  • 2021-04-17
  • 2021-07-28
  • 2021-08-26
  • 2021-10-22
  • 2021-07-10
  • 2021-07-22
相关资源
相似解决方案