Table of Contents

Method ToList

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

ToList<T>(IMappedQuery<T>)

Reads every mapped row into a new List<T>.

public static List<T> ToList<T>(this IMappedQuery<T> query)

Parameters

query IMappedQuery<T>

The query to execute.

Returns

List<T>

A list of all the rows, in the order the database returned them. The list is empty if there are no rows.

Type Parameters

T

The 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