Method ToArray
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
ToArray<T>(IMappedQuery<T>)
Reads every mapped row into a new array.
public static T[] ToArray<T>(this IMappedQuery<T> query)
Parameters
queryIMappedQuery<T>The query to execute.
Returns
- T[]
An array of all the rows, in the order the database returned them. The array is empty if there are no rows.
Type Parameters
TThe type each row is mapped to.
Remarks
All rows are buffered in memory before the call returns. Use Read(Action<IEnumerable<T>>) to process very large results as a stream.
- See Also