sách gpt4 ăn đã đi

c# - 为什么 IQueryable 缺少 IQueryable 拥有的所有扩展方法?

In lại 作者:太空狗 更新时间:2023-10-30 01:05:44 25 4
mua khóa gpt4 giày nike

IEnumerable相同对比IEnumerable .这是疏忽吗?或者当您没有指定类型来实现像 .Count() 这样的扩展时,是否存在问题? , .Where()等不可能?

câu trả lời hay nhất

từtài liệu :

The IQueryable interface is intended for implementation by query providers. It is only supposed to be implemented by providers that also implement IQueryable. If the provider does not also implement IQueryable, the standard query operators cannot be used on the provider's data source.

IEnumerable是 .NET 没有泛型的时代的产物(当然,我并不是说它已被弃用)。在泛型之后,它一直为向后兼容而存在,因此 IEnumerable被介绍。 có thể truy vấn được保持一致。基本上,鉴于现在有泛型,并且鉴于其优势,仅在泛型接口(interface)上实现这些扩展是很有用的。非通用的总是可以使用 Cast 转换为通用的

关于c# - 为什么 IQueryable 缺少 IQueryable 拥有的所有扩展方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17579365/

25 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress