Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8718773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:37:45+00:00 2026-06-13T06:37:45+00:00

I use dapper to return objects from my database as IEnumerable. As default dapper

  • 0

I use dapper to return objects from my database as IEnumerable.
As default dapper has buffer setting set to true.

How does this work?

If dapper cache the first query and then get the objects from memory.

What happens if someone edit/delete/add rows in the table. Must dapper recache all data again for this query?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:37:45+00:00Added an answer on June 13, 2026 at 6:37 am

    The buffer is unrelated to cache. Dapper does not include any kind of data-cache (although it does have a cache related to how it processes commands, i.e. “this command string, with this type of parameter, and this type of entity – has these associated dynamically generated methods to configure the command and populate the objects”).

    What this switch really means is:

    • false: will iterate items as they are recieved/consumed – basically, an iterator-block around an IDataReader
      • minus: you can only iterate it once (unless you are happy to re-run the query)
      • plus: you can iterate over immense queries (many millions of rows), without needing them all in-memory at once – since you’re only ever really looking at the current row being yielded
      • plus: you don’t need to wait for the end of the data to start iterating – as soon as it has at least one row, you’re good to go
      • minus: the connection is in-use while you’re iterating, which can lead to “there is already an open reader on the connection” (or whatever the exact wording is) errors if you try to invoke other commands on a per-row basis (this can be mitigated by MARS)
      • minus: because the consumer can do anything they want per-item (it could take minutes per row, if they are doing something complex), the command/reader might be open for longer
    • true (the default): the data is fully consumed into a List<T> before it hands it back to you
      • plus: you can iterate it as many times as you like
      • minus: if the query is immense, loading them all into memory (in a list) could be expensive / impossible
      • minus: if the query is large, there may be noticeable latency while it gathers the last row
      • plus: once you get the data, the command is complete – so there is no conflict between that and subsequent operations
      • plus: as soon as you get the data, the command has already released any resources (locks etc), so you’re having minimal impact on the server

    Most queries only return a moderate amount of data (say, less than 100 records), so we’re happy that the default (true) gives the most appropriate behavior for most scenarios. But we make the option available to you, to cater for different usage scenarios.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to use Dapper to return a set of Shares and an associated
Is there any way to use Dapper.NET with stored procs that return multiple result
USE master GO DECLARE @DbName nvarchar(MAX) SET @DbName = N'DataBase' ALTER DATABASE @DbName SET
I'm trying to use Dapper simply to map my database tables to types in
I'm trying to use the multimapping feature of Dapper to return a list of
I am wanting to use the MVCMiniProfiler with Dapper. Is this possible beyond wrapping
Is this the least amount of code I can use to convert a Dapper
I have a customer who has dictated that I use Dapper ORM, which I've
My application has be entity model as below and use Dapper public class Goal
Below is the code I'm using to return a paged list of objects: string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.