Dapper dot net has a buffer
parameter (a bool), but as far as I can tell the only thing it does is cast the result to a list before returning it.
As per the documentation:
Dapper's default behavior is to execute your sql and buffer the entire reader on return. This is ideal in most cases as it minimizes shared locks in the db and cuts down on db network time.
However when executing huge queries you may need to minimize memory footprint and only load objects as needed. To do so pass, buffered: false into the Query method.
I'm not sure how casting the result to a list accomplishes this. Am I missing something? My only idea is that it is supposed to set the CommandBehavior
for the ExecuteReader
to CommandBehavior.SequentialAccess
(but it doesn't).