Question

Example of Cache aspect using of Bltoolkit (http://bltoolkit.net/doc/Aspects/CacheAspect.htm) works for one instance only. If I create another instance and call cached method it will return value cached for first instance.

To achieve the goal I could create another method that receives some unique object key and move 'Cache' attribute to that new method, but that looks like overkill: for each method to be cached I need to create another instance method with an additional parameter.

Is there any better way to implement Caching with Bltoolkit? Am I missing something?

Thank you.

Was it helpful?

Solution

Heh, now that sounds like a joke :)

Decided to look on the Russian-language forum where BLtoolkit originally appeared and found MY OWN 5 years old topic about the same problem: http://www.rsdn.ru/forum/prj.rfd/2966573.flat#2966573

Since that time solution was already implemented, that is another attribute: InstanceCacheAttribute

:) Good luck! :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top