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
FieldCount
public int FieldCount { get; }
Property Value
IsClosed
Gets a value indicating whether the data reader is closed.
public bool IsClosed { get; }
Property Value
this[int]
public object this[int i] { get; }
Parameters
i
int
Property Value
this[string]
public object this[string name] { get; }
Parameters
name
string
Property Value
RecordsAffected
Gets the number of rows affected. Always returns 0.
public int RecordsAffected { get; }
Property Value
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
booltrue to release both managed and unmanaged resources; false to release only unmanaged resources.
GetBoolean(int)
public bool GetBoolean(int i)
Parameters
i
int
Returns
GetByte(int)
public byte GetByte(int i)
Parameters
i
int
Returns
GetBytes(int, long, byte[], int, int)
public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferOffset, int length)
Parameters
Returns
GetChar(int)
public char GetChar(int i)
Parameters
i
int
Returns
GetChars(int, long, char[], int, int)
public long GetChars(int i, long fieldOffset, char[] buffer, int bufferOffset, int length)
Parameters
Returns
GetData(int)
public IDataReader GetData(int i)
Parameters
i
int
Returns
GetDataTypeName(int)
public string GetDataTypeName(int i)
Parameters
i
int
Returns
GetDateTime(int)
public DateTime GetDateTime(int i)
Parameters
i
int
Returns
GetDecimal(int)
public decimal GetDecimal(int i)
Parameters
i
int
Returns
GetDouble(int)
public double GetDouble(int i)
Parameters
i
int
Returns
GetFieldType(int)
public Type GetFieldType(int i)
Parameters
i
int
Returns
GetFloat(int)
public float GetFloat(int i)
Parameters
i
int
Returns
GetGuid(int)
public Guid GetGuid(int i)
Parameters
i
int
Returns
GetInt16(int)
public short GetInt16(int i)
Parameters
i
int
Returns
GetInt32(int)
public int GetInt32(int i)
Parameters
i
int
Returns
GetInt64(int)
public long GetInt64(int i)
Parameters
i
int
Returns
GetName(int)
public string GetName(int i)
Parameters
i
int
Returns
GetOrdinal(string)
public int GetOrdinal(string name)
Parameters
name
string
Returns
GetSchemaTable()
Returns a DataTable that describes the column metadata of the data reader.
public DataTable GetSchemaTable()
Returns
GetString(int)
public string GetString(int i)
Parameters
i
int
Returns
GetValue(int)
public object GetValue(int i)
Parameters
i
int
Returns
GetValues(object[])
public int GetValues(object[] values)
Parameters
values
object[]
Returns
IsDBNull(int)
public bool IsDBNull(int i)
Parameters
i
int
Returns
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.