为什么使用Func而不是Predicate?
- 论坛
- 为什么使用Func<T,bool>而不是Predicate<T>?
17 浏览
为什么使用Func而不是Predicate?
这只是一个好奇的问题,我想知道是否有人能给出一个好的答案:
在.NET Framework类库中,我们有以下两个方法:
public static IQueryableWhere ( this IQueryable source, Expression > predicate ) public static IEnumerable Where ( this IEnumerable source, Func predicate )
为什么它们使用`Func