ZZZ Code AI
Report Issues
Suggest Features
Login
Dapper Tools
Chat
Code Explain
Seed Data Generator
Sql Generator
Stored Procedure Generator
Entity to Table Converter
Table to Entity Converter
Sql Injection Detector
More Tools
What does the buffered parameter for the Read and ReadAsync methods in Dapper?
<p>In Dapper, the <a href="https://www.learndapper.com/misc/buffered-unbuffered">buffered parameter</a> on the <code>Read</code> and <code>ReadAsync</code> methods indicates whether the data should be buffered (loaded into memory at once) or unbuffered (streamed one row at a time). By default, this parameter is <code>true</code>, meaning data is buffered. If set to <code>false</code>, data is read row by row, which can reduce memory usage for large result sets.</p> <pre><code class="language-csharp">string sql = "SELECT * FROM Customer; SELECT * FROM Order"; using (var connection = new SqlConnection(connectionString)) { using (var multi = connection.QueryMultiple(sql)) { var customers = multi.Read<Customer>(buffered: false); var orders = multi.Read<Order>(buffered: false); } } </code></pre>
Sponsored by
Dapper Plus
This field is required
A text with a minimum of 10 characters is required
Send
Legal & Licensing
Answer generated by AI may produce inaccurate information about code, people, facts, and more.
Advertising Break!
5
seconds left
Did you know...
That you can now sponsor this project on
GitHub
?