LinqToObject和LinqToSql的区别

以下不难看出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.IQueryable1 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.IEnumerable1 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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值