Interface IReader<TRow>

Interface for a synchronous reader.

Namespace: Cesil
Assembly: Cesil.dll
Syntax
public interface IReader<TRow> : IDisposable
Type Parameters
Name Description
TRow

Methods

EnumerateAll()

Returns an enumerable that will read and yield one row at a time.

The returned IEnumerable(TRow) may only be enumerated once.

Declaration
IEnumerable<TRow> EnumerateAll()
Returns
Type Description
System.Collections.Generic.IEnumerable<TRow>

ReadAll()

Reads all rows, returning the entire set at once.

Declaration
List<TRow> ReadAll()
Returns
Type Description
System.Collections.Generic.List<TRow>

ReadAll<TCollection>(TCollection)

Reads all rows into the provided collection, returning the entire set at once.

into must be non-null.

Declaration
TCollection ReadAll<TCollection>(TCollection into)
    where TCollection : class, ICollection<TRow>
Parameters
Type Name Description
TCollection into
Returns
Type Description
TCollection
Type Parameters
Name Description
TCollection

TryRead(out TRow)

Reads a single row, populating row and returning true if a row was available and false otherwise.

Declaration
bool TryRead(out TRow row)
Parameters
Type Name Description
TRow row
Returns
Type Description
System.Boolean

TryReadWithComment()

Reads a single row or comment.

Distinguish between a row, comment, or nothing by inspecting ReadWithCommentResult(T).ResultType.

Note, it is possible for row to be initialized BUT for this method to return a comment or no value. In that case row should be ignored.

Declaration
ReadWithCommentResult<TRow> TryReadWithComment()
Returns
Type Description
ReadWithCommentResult<TRow>

TryReadWithCommentReuse(ref TRow)

Reads a single row (storing into an existing instance of a row if provided) or comment.

Distinguish between a row, comment, or nothing by inspecting ReadWithCommentResult(T).ResultType.

Row will be initialized if need be.

Note, it is possible for row to be initialized BUT for this method to return a comment or no value. In that case row should be ignored.

Declaration
ReadWithCommentResult<TRow> TryReadWithCommentReuse(ref TRow row)
Parameters
Type Name Description
TRow row
Returns
Type Description
ReadWithCommentResult<TRow>

TryReadWithReuse(ref TRow)

Reads a single row into the existing instance of row, returning true if a row was available and false otherwise.

Row will be initialized if need be.

Note, it is possible for row to be initialized BUT for this method to return false. In that case row should be ignored>

Declaration
bool TryReadWithReuse(ref TRow row)
Parameters
Type Name Description
TRow row
Returns
Type Description
System.Boolean
In This Article
Back to top Generated by DocFX