Table of Contents

Class ListDataReader<T>

Namespace
FluentCommand
Assembly
FluentCommand.dll

Read a list of items using an IDataReader

public class ListDataReader<T> : IDataReader, IDataRecord, IDisposable where T : class

Type Parameters

T

The type of items being read

Inheritance
ListDataReader<T>
Implements
Inherited Members
Extension Methods

Constructors

ListDataReader(IEnumerable<T>, IEnumerable<string>)

Initializes a new instance of the ListDataReader<T> class.

public ListDataReader(IEnumerable<T> list, IEnumerable<string> ignoreNames = null)

Parameters

list IEnumerable<T>

The list of items to read

ignoreNames IEnumerable<string>

A list of property names to ignore in the reader

Properties

Depth

Gets a value indicating the depth of nesting for the current row. Always returns 0.

public int Depth { get; }

Property Value

int

FieldCount

public int FieldCount { get; }

Property Value

int

IsClosed

Gets a value indicating whether the data reader is closed.

public bool IsClosed { get; }

Property Value

bool

this[int]

public object this[int i] { get; }

Parameters

i int

Property Value

object

this[string]

public object this[string name] { get; }

Parameters

name string

Property Value

object

RecordsAffected

Gets the number of rows affected. Always returns 0.

public int RecordsAffected { get; }

Property Value

int

Methods

Close()

Closes the data reader and releases resources.

public void Close()

Dispose()

Releases all resources used by the ListDataReader<T>.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources used by the ListDataReader and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetBoolean(int)

public bool GetBoolean(int i)

Parameters

i int

Returns

bool

GetByte(int)

public byte GetByte(int i)

Parameters

i int

Returns

byte

GetBytes(int, long, byte[], int, int)

public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferOffset, int length)

Parameters

i int
fieldOffset long
buffer byte[]
bufferOffset int
length int

Returns

long

GetChar(int)

public char GetChar(int i)

Parameters

i int

Returns

char

GetChars(int, long, char[], int, int)

public long GetChars(int i, long fieldOffset, char[] buffer, int bufferOffset, int length)

Parameters

i int
fieldOffset long
buffer char[]
bufferOffset int
length int

Returns

long

GetData(int)

public IDataReader GetData(int i)

Parameters

i int

Returns

IDataReader

GetDataTypeName(int)

public string GetDataTypeName(int i)

Parameters

i int

Returns

string

GetDateTime(int)

public DateTime GetDateTime(int i)

Parameters

i int

Returns

DateTime

GetDecimal(int)

public decimal GetDecimal(int i)

Parameters

i int

Returns

decimal

GetDouble(int)

public double GetDouble(int i)

Parameters

i int

Returns

double

GetFieldType(int)

public Type GetFieldType(int i)

Parameters

i int

Returns

Type

GetFloat(int)

public float GetFloat(int i)

Parameters

i int

Returns

float

GetGuid(int)

public Guid GetGuid(int i)

Parameters

i int

Returns

Guid

GetInt16(int)

public short GetInt16(int i)

Parameters

i int

Returns

short

GetInt32(int)

public int GetInt32(int i)

Parameters

i int

Returns

int

GetInt64(int)

public long GetInt64(int i)

Parameters

i int

Returns

long

GetName(int)

public string GetName(int i)

Parameters

i int

Returns

string

GetOrdinal(string)

public int GetOrdinal(string name)

Parameters

name string

Returns

int

GetSchemaTable()

Returns a DataTable that describes the column metadata of the data reader.

public DataTable GetSchemaTable()

Returns

DataTable

A DataTable describing the column metadata.

GetString(int)

public string GetString(int i)

Parameters

i int

Returns

string

GetValue(int)

public object GetValue(int i)

Parameters

i int

Returns

object

GetValues(object[])

public int GetValues(object[] values)

Parameters

values object[]

Returns

int

IsDBNull(int)

public bool IsDBNull(int i)

Parameters

i int

Returns

bool

NextResult()

Advances the data reader to the next result. Always returns false.

public bool NextResult()

Returns

bool

false, as multiple result sets are not supported.

Read()

Advances the data reader to the next record.

public bool Read()

Returns

bool

true if there are more rows; otherwise, false.