Esempio n. 1
0
        public TCollection ReadAll <TCollection>(TCollection into)
            where TCollection : class, ICollection <T>
        {
            AssertNotDisposed(this);
            AssertNotPoisoned(Configuration);

            Utils.CheckArgumentNull(into, nameof(into));
            Utils.CheckImmutableReadInto <TCollection, T>(into, nameof(into));

            try
            {
                HandleRowEndingsAndHeaders();

                while (true)
                {
#pragma warning disable CES0005 // T is generic, and null is legal, but since T isn't known to be a class we have to forgive null here
                    T _ = default !;
Esempio n. 2
0
        private ValueTask <TCollection> ReadAllIntoCollectionAsync <TCollection>(TCollection into, CancellationToken cancellationToken)
            where TCollection : class, ICollection <T>
        {
            AssertNotDisposed(this);
            AssertNotPoisoned(Configuration);

            Utils.CheckArgumentNull(into, nameof(into));
            Utils.CheckImmutableReadInto <TCollection, T>(into, nameof(into));

            try
            {
                var headersAndRowEndingsTask = HandleRowEndingsAndHeadersAsync(cancellationToken);
                if (!headersAndRowEndingsTask.IsCompletedSuccessfully(this))
                {
                    return(ReadAllAsync_ContinueAfterHandleRowEndingsAndHeadersAsync(this, headersAndRowEndingsTask, into, cancellationToken));
                }

                while (true)
                {
#pragma warning disable CES0005 // T is generic, and null is legal, but since T isn't known to be a class we have to forgive null here
                    T _ = default !;