之间有什么区别
public static IEnumerable<TSource> Where<TSource>
(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
和
public static IQueryable<TSource> Where<TSource>
(this IQueryable<TSource> source,
Expression<Func<TSource, bool>> predicate)
两种方法都可以以相同的方式接受 lambda 表达式。
List<string> fruits =
new List<string> { "apple", "passionfruit", "banana", "mango",
"orange", "blueberry", "grape", "strawberry" };
IEnumerable<string> query = fruits.Where(fruit => fruit.Length < 6);
为什么存在委托函数和委托函数的表达式?我必须照顾它吗?