SqlMapper.GridReader
The grid reader provides interfaces for reading multiple result sets from a Dapper query
Assembly: ServiceStack.OrmLite.dll
View Source
public class GridReader : IDisposable
Properties
IsConsumed
Has the underlying reader been consumed?
View Source
public bool IsConsumed { get; }
Command
The command associated with the reader
View Source
public IDbCommand Command { get; set; }
Methods
ReadAsync(Boolean)
Read the next grid of results, returned as a dynamic object
Note: each row can be accessed via "dynamic", or by casting to an IDictionary<string,object>
View Source
public Task<IEnumerable<dynamic>> ReadAsync(bool buffered = true)
Returns
Task<IEnumerable<System.Object>>
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | buffered | Whether to buffer the results. |
Note: each row can be accessed via "dynamic", or by casting to an IDictionary<string,object> |
ReadFirstAsync()
Read an individual row of the next grid of results, returned as a dynamic object
Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object>
View Source
public Task<dynamic> ReadFirstAsync()
Returns
Task<System.Object>
ReadFirstOrDefaultAsync()
Read an individual row of the next grid of results, returned as a dynamic object
Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object>
View Source
public Task<dynamic> ReadFirstOrDefaultAsync()
Returns
Task<System.Object>
ReadSingleAsync()
Read an individual row of the next grid of results, returned as a dynamic object
Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object>
View Source
public Task<dynamic> ReadSingleAsync()
Returns
Task<System.Object>
ReadSingleOrDefaultAsync()
Read an individual row of the next grid of results, returned as a dynamic object
Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object>
View Source
public Task<dynamic> ReadSingleOrDefaultAsync()
Returns
Task<System.Object>
ReadAsync(Type, Boolean)
Read the next grid of results
View Source
public Task<IEnumerable<object>> ReadAsync(Type type, bool buffered = true)
Returns
Task<IEnumerable<System.Object>>
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to read. |
|
| System.Boolean
| buffered | Whether to buffer the results.
|
ReadFirstAsync(Type)
Read an individual row of the next grid of results
View Source
public Task<object> ReadFirstAsync(Type type)
Returns
Task<System.Object>
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to read. |
|
ReadFirstOrDefaultAsync(Type)
Read an individual row of the next grid of results.
View Source
public Task<object> ReadFirstOrDefaultAsync(Type type)
Returns
Task<System.Object>
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to read. |
|
ReadSingleAsync(Type)
Read an individual row of the next grid of results.
View Source
public Task<object> ReadSingleAsync(Type type)
Returns
Task<System.Object>
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to read. |
|
ReadSingleOrDefaultAsync(Type)
Read an individual row of the next grid of results.
View Source
public Task<object> ReadSingleOrDefaultAsync(Type type)
Returns
Task<System.Object>
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to read. |
|
ReadAsync<T>(Boolean)
Read the next grid of results.
View Source
public Task<IEnumerable<T>> ReadAsync<T>(bool buffered = true)
Returns
Task<IEnumerable<<T>>>
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | buffered | Whether the results should be buffered in memory. |
|
Type Parameters
Name | Description |
---|---|
T | The type to read. |
ReadFirstAsync<T>()
Read an individual row of the next grid of results.
View Source
public Task<T> ReadFirstAsync<T>()
Returns
Task<<T>>
Type Parameters
Name | Description |
---|---|
T | The type to read. |
ReadFirstOrDefaultAsync<T>()
Read an individual row of the next grid of results.
View Source
public Task<T> ReadFirstOrDefaultAsync<T>()
Returns
Task<<T>>
Type Parameters
Name | Description |
---|---|
T | The type to read. |
ReadSingleAsync<T>()
Read an individual row of the next grid of results.
View Source
public Task<T> ReadSingleAsync<T>()
Returns
Task<<T>>
Type Parameters
Name | Description |
---|---|
T | The type to read. |
ReadSingleOrDefaultAsync<T>()
Read an individual row of the next grid of results.
View Source
public Task<T> ReadSingleOrDefaultAsync<T>()
Returns
Task<<T>>
Type Parameters
Name | Description |
---|---|
T | The type to read. |
Read(Boolean)
Read the next grid of results, returned as a dynamic object.
Note: each row can be accessed via "dynamic", or by casting to an IDictionary<string,object>
View Source
public IEnumerable<dynamic> Read(bool buffered = true)
Returns
IEnumerable<System.Object>
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | buffered | Whether the results should be buffered in memory. |
Note: each row can be accessed via "dynamic", or by casting to an IDictionary<string,object> |
ReadFirst()
Read an individual row of the next grid of results, returned as a dynamic object.
Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object>
View Source
public dynamic ReadFirst()
Returns
System.Object
ReadFirstOrDefault()
Read an individual row of the next grid of results, returned as a dynamic object.
Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object>
View Source
public dynamic ReadFirstOrDefault()
Returns
System.Object
ReadSingle()
Read an individual row of the next grid of results, returned as a dynamic object.
Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object>
View Source
public dynamic ReadSingle()
Returns
System.Object
ReadSingleOrDefault()
Read an individual row of the next grid of results, returned as a dynamic object.
Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object>
View Source
public dynamic ReadSingleOrDefault()
Returns
System.Object
Read<T>(Boolean)
Read the next grid of results.
View Source
public IEnumerable<T> Read<T>(bool buffered = true)
Returns
IEnumerable<<T>>
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | buffered | Whether the results should be buffered in memory. |
|
Type Parameters
Name | Description |
---|---|
T | The type to read. |
ReadFirst<T>()
Read an individual row of the next grid of results.
View Source
public T ReadFirst<T>()
Returns
<T>
Type Parameters
Name | Description |
---|---|
T | The type to read. |
ReadFirstOrDefault<T>()
Read an individual row of the next grid of results.
View Source
public T ReadFirstOrDefault<T>()
Returns
<T>
Type Parameters
Name | Description |
---|---|
T | The type to read. |
ReadSingle<T>()
Read an individual row of the next grid of results.
View Source
public T ReadSingle<T>()
Returns
<T>
Type Parameters
Name | Description |
---|---|
T | The type to read. |
ReadSingleOrDefault<T>()
Read an individual row of the next grid of results.
View Source
public T ReadSingleOrDefault<T>()
Returns
<T>
Type Parameters
Name | Description |
---|---|
T | The type to read. |
Read(Type, Boolean)
Read the next grid of results.
View Source
public IEnumerable<object> Read(Type type, bool buffered = true)
Returns
IEnumerable<System.Object>
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to read. |
|
| System.Boolean
| buffered | Whether to buffer the results.
|
ReadFirst(Type)
Read an individual row of the next grid of results.
View Source
public object ReadFirst(Type type)
Returns
System.Object
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to read. |
|
ReadFirstOrDefault(Type)
Read an individual row of the next grid of results.
View Source
public object ReadFirstOrDefault(Type type)
Returns
System.Object
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to read. |
|
ReadSingle(Type)
Read an individual row of the next grid of results.
View Source
public object ReadSingle(Type type)
Returns
System.Object
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to read. |
|
ReadSingleOrDefault(Type)
Read an individual row of the next grid of results.
View Source
public object ReadSingleOrDefault(Type type)
Returns
System.Object
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to read. |
|
Read<TFirst, TSecond, TReturn>(Func<TFirst, TSecond, TReturn>, String, Boolean)
Read multiple objects from a single record set on the grid.
View Source
public IEnumerable<TReturn> Read<TFirst, TSecond, TReturn>(Func<TFirst, TSecond, TReturn> func, string splitOn = "id", bool buffered = true)
Returns
IEnumerable<<TReturn>>
Parameters
Type | Name | Description |
---|---|---|
Func<<TFirst>,<TSecond>,<TReturn>> | func | The mapping function from the read types to the return type. |
|
| System.String
| splitOn | The field(s) we should split and read the second object from (defaults to "id")
|
| System.Boolean
| buffered | Whether to buffer results in memory.
|
Type Parameters
Name | Description |
---|---|
TFirst | The first type in the record set. |
TSecond | The second type in the record set. |
TReturn | The type to return from the record set. |
Read<TFirst, TSecond, TThird, TReturn>(Func<TFirst, TSecond, TThird, TReturn>, String, Boolean)
Read multiple objects from a single record set on the grid.
View Source
public IEnumerable<TReturn> Read<TFirst, TSecond, TThird, TReturn>(Func<TFirst, TSecond, TThird, TReturn> func, string splitOn = "id", bool buffered = true)
Returns
IEnumerable<<TReturn>>
Parameters
Type | Name | Description |
---|---|---|
Func<<TFirst>,<TSecond>,<TThird>,<TReturn>> | func | The mapping function from the read types to the return type. |
|
| System.String
| splitOn | The field(s) we should split and read the second object from (defaults to "id")
|
| System.Boolean
| buffered | Whether to buffer results in memory.
|
Type Parameters
Name | Description |
---|---|
TFirst | The first type in the record set. |
TSecond | The second type in the record set. |
TThird | The third type in the record set. |
TReturn | The type to return from the record set. |
Read<TFirst, TSecond, TThird, TFourth, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TReturn>, String, Boolean)
Read multiple objects from a single record set on the grid
View Source
public IEnumerable<TReturn> Read<TFirst, TSecond, TThird, TFourth, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TReturn> func, string splitOn = "id", bool buffered = true)
Returns
IEnumerable<<TReturn>>
Parameters
Type | Name | Description |
---|---|---|
Func<<TFirst>,<TSecond>,<TThird>,<TFourth>,<TReturn>> | func | The mapping function from the read types to the return type. |
|
| System.String
| splitOn | The field(s) we should split and read the second object from (defaults to "id")
|
| System.Boolean
| buffered | Whether to buffer results in memory.
|
Type Parameters
Name | Description |
---|---|
TFirst | The first type in the record set. |
TSecond | The second type in the record set. |
TThird | The third type in the record set. |
TFourth | The fourth type in the record set. |
TReturn | The type to return from the record set. |
Read<TFirst, TSecond, TThird, TFourth, TFifth, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TFifth, TReturn>, String, Boolean)
Read multiple objects from a single record set on the grid
View Source
public IEnumerable<TReturn> Read<TFirst, TSecond, TThird, TFourth, TFifth, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TFifth, TReturn> func, string splitOn = "id", bool buffered = true)
Returns
IEnumerable<<TReturn>>
Parameters
Type | Name | Description |
---|---|---|
Func<<TFirst>,<TSecond>,<TThird>,<TFourth>,<TFifth>,<TReturn>> | func | The mapping function from the read types to the return type. |
|
| System.String
| splitOn | The field(s) we should split and read the second object from (defaults to "id")
|
| System.Boolean
| buffered | Whether to buffer results in memory.
|
Type Parameters
Name | Description |
---|---|
TFirst | The first type in the record set. |
TSecond | The second type in the record set. |
TThird | The third type in the record set. |
TFourth | The fourth type in the record set. |
TFifth | The fifth type in the record set. |
TReturn | The type to return from the record set. |
Read<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TReturn>, String, Boolean)
Read multiple objects from a single record set on the grid
View Source
public IEnumerable<TReturn> Read<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TReturn> func, string splitOn = "id", bool buffered = true)
Returns
IEnumerable<<TReturn>>
Parameters
Type | Name | Description |
---|---|---|
Func<<TFirst>,<TSecond>,<TThird>,<TFourth>,<TFifth>,<TSixth>,<TReturn>> | func | The mapping function from the read types to the return type. |
|
| System.String
| splitOn | The field(s) we should split and read the second object from (defaults to "id")
|
| System.Boolean
| buffered | Whether to buffer results in memory.
|
Type Parameters
Name | Description |
---|---|
TFirst | The first type in the record set. |
TSecond | The second type in the record set. |
TThird | The third type in the record set. |
TFourth | The fourth type in the record set. |
TFifth | The fifth type in the record set. |
TSixth | The sixth type in the record set. |
TReturn | The type to return from the record set. |
Read<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TReturn>, String, Boolean)
Read multiple objects from a single record set on the grid
View Source
public IEnumerable<TReturn> Read<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TReturn>(Func<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TReturn> func, string splitOn = "id", bool buffered = true)
Returns
IEnumerable<<TReturn>>
Parameters
Type | Name | Description |
---|---|---|
Func<<TFirst>,<TSecond>,<TThird>,<TFourth>,<TFifth>,<TSixth>,<TSeventh>,<TReturn>> | func | The mapping function from the read types to the return type. |
|
| System.String
| splitOn | The field(s) we should split and read the second object from (defaults to "id")
|
| System.Boolean
| buffered | Whether to buffer results in memory.
|
Type Parameters
Name | Description |
---|---|
TFirst | The first type in the record set. |
TSecond | The second type in the record set. |
TThird | The third type in the record set. |
TFourth | The fourth type in the record set. |
TFifth | The fifth type in the record set. |
TSixth | The sixth type in the record set. |
TSeventh | The seventh type in the record set. |
TReturn | The type to return from the record set. |
Read<TReturn>(Type[], Func<Object[], TReturn>, String, Boolean)
Read multiple objects from a single record set on the grid
View Source
public IEnumerable<TReturn> Read<TReturn>(Type[] types, Func<object[], TReturn> map, string splitOn = "id", bool buffered = true)
Returns
IEnumerable<<TReturn>>
Parameters
Type | Name | Description |
---|---|---|
Type[] | types | The types to read from the result set. |
|
| Func<System.Object[],<TReturn>>
| map | The mapping function from the read types to the return type.
|
| System.String
| splitOn | The field(s) we should split and read the second object from (defaults to "id")
|
| System.Boolean
| buffered | Whether to buffer results in memory.
|
Type Parameters
Name | Description |
---|---|
TReturn | The type to return from the record set. |
Dispose()
Dispose the grid, closing and disposing both the underlying reader and command.
View Source
public void Dispose()