高级查询
模糊查(包含):.Contains(name)
开头:.StartsWith(name)
结尾:.EndsWith(name)
个数:.Count()
最大值:Max(r => r.price);
最小值:Min(r => r.price);
平均值:Average(r => r.price);
求和:Sum(r => r.price);
升序:OrderBy(r => r.price)
降序:OrderByDescending(r => r.price)
分页:
public List<car> Select(int count, int number)
{
return con.car.Skip(count * (number - 1)).Take(count).ToList();
}
组合查询:
集合的交集
All.Intersect(oillist)