Moved to Github: https://github.com/agbell/attribute-based-caching

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.

Key terms:
  • c# caching
  • in memory cache
  • application caching
  • dot net cache

Last edited Nov 12, 2013 at 11:24 PM by adamgbell, version 7