Reputation: 71228
I have repositories like this in my application
public class FooRepo
{
public Foo Get(int id)
{
return Foo from Db;
}
}
I'm just wondering if there is possible to do some caching for the methods inside the repository, or probably there is no need because sql-server does it for me, but if needed could someone point/show me some solutions
thnx
Upvotes: 0
Views: 206
Reputation: 294317
LINQ queries can be cached using SqlDependency active caching. SqlDependency relies on Query Notifications to get invalidation notifications from the server when the data has changed.
Upvotes: 0
Reputation: 62111
Depends. Caching IN The repository is a LOT faster than asking the database. For many data items it makes a lot of sense.
Upvotes: 1