Dapper - Buffered
Description
- Default: True
A buffered query return the entire reader at once. That is ideal in most scenario.
A non-buffered query is equivalent as streaming. You only load objects on demand. That can be useful for a very large query to reduce memory usage.
string sql = "SELECT * FROM OrderDetails;";
using (var connection = new SqlConnection(FiddleHelper.GetConnectionStringSqlServerW3Schools()))
{
var orderDetails = connection.Query<OrderDetail>(sql, buffered: false).ToList();
FiddleHelper.WriteTable(orderDetails.Take(10));
}
Try it: .NET Core | .NET Framework