IAsyncEnumerable的Linq方法 [英] Linq methods for IAsyncEnumerable
问题描述
在使用 IEnumerable< T>
时,有 System.Linq
命名空间中的内置扩展方法,例如 Skip
,在哪里
和选择
一起使用.
When working with an IEnumerable<T>
there are the build-in extension methods from the System.Linq
namespace such as Skip
, Where
and Select
to work with.
当Microsoft在C#8中添加 IAsyncEnumerable
时,他们是否还添加了新的Linq方法来支持此功能?
When Microsoft added IAsyncEnumerable
in C#8 did they also add new Linq methods to support this?
我当然可以自己实现这些方法,或者找到一些可以做到这一点的程序包,但是我更喜欢使用一种语言标准的方法.
I could of course implement these methods myself, or maybe find some package which does that, but I'd prefer to use a language-standard method if it exists.
推荐答案
在 System.Linq.Async
命名空间中,有 System.Linq.Async
包(它是 System.Reactive
的一部分).
您可以阅读此github问题.可以找到 System.Linq.Async
的源此处.
There is, in the System.Linq.Async
namespace from the System.Reactive
package. If you don't want the full System.Reactive
package, you can use the System.Linq.Async
package directly (it's part of System.Reactive
).
You can read this github issue. The source for System.Linq.Async
can be found here.
这篇关于IAsyncEnumerable的Linq方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!