public async Task <bool> MoveNext(CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); var hasNext = await(_reader == null ? InitializeAndReadAsync(cancellationToken) : _reader.ReadAsync(cancellationToken)) .WithCurrentCulture(); _current = !hasNext ? default(T) : _enumerable._shaper(_reader); return(hasNext); }
public async Task <bool> MoveNext(CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); var hasNext = await(_reader == null ? InitializeAndReadAsync(cancellationToken) : _reader.ReadAsync(cancellationToken)) .WithCurrentCulture(); if (!hasNext) { // H.A.C.K.: Workaround https://github.com/Reactive-Extensions/Rx.NET/issues/5 Dispose(); _current = default(T); } else { _current = _enumerable._shaper(_reader); } return(hasNext); }