I'm using Dapper mainly for calling stored procedures in the database MSSQL 2008 R2.I do not have classes that map to database tables. Most of the data ends up in
IEnumerable <Dynamic> and is transmitted to the grid on the screen.
Is there a ready to use solution for data buffering that I could use? (I need to use it on the MVC).
The data in the database are both static and dynamic in nature.I use the repository model to access the data.
Dapper doesn't include any inbuilt data caching features (although it uses extensive caching internally for the meta-programming layer): it aims itself squarely at the ADO.NET stuff - however, you could use pretty much any off-the-shelf caching component, including the HTTP runtime cache (
HttpContext.Current.Cache), or the newer
ObjectCache etc implementations. Because these just take objects, it should work fine.
If you are using a distributed cache (maybe via app-fabric, redis, or memcached) then you'd need the data to be serializable. In that scenario, I would strongly suggest using formal POCO types for the binding, rather than the
dynamic API. As an example, in-house we use dapper to populate POCOs that are annotated with protobuf-net markers for serialization, and stored via BookSleeve to redis. Which sounds more complicated than it actually is.