Azad Soleimani
Azad Soleimani

Reputation: 31

How to Cache some objects during a request in .Net

we're working on a project which developed with ASP.net MVC technology and based on the layered architecture; in addition, we use ADO.Net to fetching data by SQL Store Procedures and generating object models in "DataAccess" Layer (I know this is an old technology to fetch data, but we couldn't migrate to EF or other ORMs).

our Architecture Diagram

we decide to cache some cacheable Object models which inherited "Icacheable" Interface, yet we don't want to cache the objects forever(until the application is working); in fact, we just need to cache them during a request and after that dispose of cached objects.

In here there are two questions?

1) which layer is better for doing this caching? Repository or DataAccess(or maybe other layers!)?

2) how to we could do this?

Upvotes: 0

Views: 242

Answers (0)

Related Questions