On Dapper's documentation found here it states:
"Limitations and caveats
Dapper caches information about every query it runs, this allow it to materialize objects quickly and process parameters quickly. The current implementation caches this information in a ConcurrentDictionary object."
What exactly does this mean? Ex: Is it caching returned data, or the query itself, or bits of both?
It also says that "this [cached] data is never flushed". How does this effect the "cached information" if the design schema of the table(s) you are querying is changed?
As far as I know has each query you issue an
Identity
, depending on the sql query, its command type and its parameters. The cache is a dictionary with concurrent access.This
CacheInfo
object contains theIDataReader
andIDBCommand
functions and some control counters which limit the cached amount.Since no server-side (database schema etc.) are cached, it actually doesn't have any influence.
Edit: Thats how the Identity class looks like used for caching.
And here's the CacheInfo
And finally the container of the cache.
Have a look at the source code, its very well written and easy to follow / debug. Just drag the file into your project.