<PackageReference Include="System.Reactive" Version="6.1.0" />

AnonymousEnumerable<T>

using System.Collections; using System.Collections.Generic; using System.Runtime.CompilerServices; namespace System.Reactive { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] internal sealed class AnonymousEnumerable<[System.Runtime.CompilerServices.Nullable(2)] T> : IEnumerable<T>, IEnumerable { private readonly Func<IEnumerator<T>> _getEnumerator; public AnonymousEnumerable(Func<IEnumerator<T>> getEnumerator) { _getEnumerator = getEnumerator; } public IEnumerator<T> GetEnumerator() { return _getEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return _getEnumerator(); } } }