CsvReaderTResult Class

Provides read-only forward access to the data of a CSV file.

Definition

Namespace: FolkerKinzel.CsvTools.Mappings
Assembly: FolkerKinzel.CsvTools.Mappings (in FolkerKinzel.CsvTools.Mappings.dll) Version: 1.1.0+1263e8243dc2cd78095f678f813d7d9c52ea4315
C#
public sealed class CsvReader<TResult> : IEnumerable<TResult>, 
	IEnumerable, IEnumerator<TResult>, IEnumerator, IDisposable
Inheritance
Object    CsvReaderTResult
Implements
IEnumerableTResult, IEnumeratorTResult, IEnumerable, IEnumerator, IDisposable

Type Parameters

TResult
Generic type parameter for the data type to which the contents of each row of the CSV will be converted.

Remarks

The class implements IEnumerableT. A CsvReaderTResult instance can be iterated with foreach or queried using Linq methods. Note that an instance can only be iterated once; if an attempt is made to iterate it twice, an ObjectDisposedException is thrown.

  Tip

Use the methods of CsvConverter to create an instance!

Constructors

CsvReaderTResult(CsvReader, CsvToTResult, Boolean) Initializes a new CsvReaderTResult instance.
CsvReaderTResult(CsvReader, CsvMapping, FuncObject, TResult, Boolean) Initializes a new CsvReaderTResult instance.

Methods

DisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
GetEnumeratorReturns an enumerator that iterates through the collection.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)
TryReadTries to read the next TResult from the CSV file.

Extension Methods

SaveCsvTResult Saves a collection of TSource instances as a CSV file with header row.
(Defined by CsvConverterExtension)
SaveCsvTResult Saves a collection of TSource instances as a CSV file without header row.
(Defined by CsvConverterExtension)
SaveCsvTResult Saves a collection of TSource instances as a CSV file with header row.
(Defined by CsvConverterExtension)
SaveCsvTResult Saves a collection of TSource instances as a CSV file without header row.
(Defined by CsvConverterExtension)
ToCsvTResult Converts a collection of TSource instances to a CSV String with header row.
(Defined by CsvConverterExtension)
ToCsvTResult Converts a collection of TSource instances to a CSV String without a header row.
(Defined by CsvConverterExtension)
ToCsvTResult Converts a collection of TSource instances to a CSV String with header row.
(Defined by CsvConverterExtension)
ToCsvTResult Converts a collection of TSource instances to a CSV String without a header row.
(Defined by CsvConverterExtension)

Explicit Interface Implementations

IEnumerableGetEnumeratorReturns an enumerator that iterates through a collection.
IEnumeratorCurrentGets the element in the collection at the current position of the enumerator.
IEnumeratorMoveNextAdvances the enumerator to the next element of the collection.
IEnumeratorReset Throws a NotSupportedException.
IEnumeratorTResultCurrentGets the element in the collection at the current position of the enumerator.

See Also