关于[Introducing C# 9: Extension GetEnumerator support for foreach loops]的摘要:
As you may know, in order to be able to iterate on a collection in C# with the foreach loop the collection must expose a public method GetEnumerator() which doesn’t exist on IEnumerator and IAsyncEnumerator interfaces. C# 9 allows to create an extension method to allow foreach loops on those interfaces. Let’s see in this article how to proceed.
原文地址:
https://anthonygiretti.com/2020/11/01/introducing-c-9-extension-getenumerator-support-for-foreach-loops/
赞 | 0
收藏 | 0