Project Description
Cache expensive methods calls with a declarative attribute. No custom code required. Configure caching method using unity. Options include In-process and Out-Of-Process and Off. Out-Of-Process uses Microsoft ApplicationServer.Caching.

Simple Example:

[Cache.Cacheable] //this method now cached, will only be called once per guid
public SomeExpensiveObject GetExpensiveObject(Guid userId)
{
..
}

Cache with invalidation:

[Cache.Cacheable("UniqueKeyForThisMethod")] //cache using this key plus parameter(s)
public SomeObject GetObjectById(Int32 Id)
{
...
}

[Cache.TriggerInvalidation("UniqueKeyForThisMethod")] //delete from cache using this key and passed parameter(s)
public void RemoveObjectById(Int32 Id)
{
..
}

How does it work:

Using postsharp to make method interceptions when a cached version exists

Help- It's not working.
More Info.
Download Binary.

Last edited Apr 10, 2011 at 1:53 PM by adamgbell, version 5