IEnumerable和IQueryable [英] IEnumerable and IQueryable
本文介绍了IEnumerable和IQueryable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是IEnumerable和IQueryable?
what is IEnumerable and IQueryable? and what are the difference?
推荐答案
基本上;
IEnumerable<T>
非常适合于使用内存中的集合,但是IQueryable<T>
允许使用远程数据源,例如数据库或Web服务.
IEnumerable 没有在项目之间移动的概念,它是仅向前的收藏.非常简约大多数数据源都可以提供的功能.仅使用此最小功能,LINQ即可提供所有这些出色的运算符.
也请看一下此链接;
IEnumerable和IQueryable(1)之间的区别 [ ^ ]
IEnumerable与IQueryable之间的区别(2) [
Basically;
IEnumerable<T>
is great for working with in-memory collections, butIQueryable<T>
allows for a remote data source, like a database or web service.
IEnumerable doesn’t have the concept of moving between items, it is a forward only collection. It’s very minimalistic; something that most any data source can provide. Using only this minimal functionality, LINQ can provide all of these great operators.
Also have a look at this links as well;
Difference between IEnumerable and IQueryable (1)[^]
Difference between IEnumerable and IQueryable (2)[^]
Good luck,
OI
这篇关于IEnumerable和IQueryable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文