以下不难看出IQueryable继承自IEnumerable 但是二者却有着本质的区别
复制代码
//
// 摘要:
// 提供针对特定数据源(其中数据类型未未知)评估查询的功能。
//
// 类型参数:
// T:
// 数据源中数据的类型。
public interface IQueryable : IEnumerable, IEnumerable, IQueryable
{
}
复制代码
这是IQueryable一些实现 包含表达式目录树Expression参数并内置委托
复制代码
//
// 摘要:
// Filters a sequence of values based on a predicate. Each element’s index is used
// in the logic of the predicate function.
//
// 参数:
// source:
// An System.Linq.IQueryable1 to filter. // // predicate: // A function to test each element for a condition; the second parameter of the // function represents the index of the element in the source sequence. // // 类型参数: // TSource: // The type of the elements of source. // // 返回结果: // An System.Linq.IQueryable
1 that contains elements from the input sequence that
// satisfy the condition specified by predicate.
//
// 异常:
// T:System.ArgumentNullException:
// source or predicate is null.
public static IQueryable Where(this IQueryable source, Expression<Func<TSource, int, bool>> predicate);
复制代码
这是IEnumerable类型一些实现 并不是表达式目录树仅仅是一个委托来实现
复制代码
1 //
2 // 摘要:
3 // Filters a sequence of values based on a predicate. Each element’s index is used
4 // in the logic of the predicate function.
5 //
6 // 参数:
7 // source:
8 // An System.Collections.Generic.IEnumerable1 to filter. 9 // 10 // predicate: 11 // A function to test each source element for a condition; the second parameter 12 // of the function represents the index of the source element. 13 // 14 // 类型参数: 15 // TSource: 16 // The type of the elements of source. 17 // 18 // 返回结果: 19 // An System.Collections.Generic.IEnumerable
1 that contains elements from the input
20 // sequence that satisfy the condition.
21 //
22 // 异常:
23 // T:System.ArgumentNullException:
24 // source or predicate is null.
25 public static IEnumerable Where(this IEnumerable source, Func<TSource, int, bool> predicate);
USB Microphone https://www.soft-voice.com/
Wooden Speakers https://www.zeshuiplatform.com/
亚马逊测评 www.yisuping.cn
深圳网站建设www.sz886.com