/cacheable

A set of extensions to provide caching support on mediator based request handlers.

Primary LanguageC#MIT LicenseMIT

cacheable

Build status NuGet NuGet CodeFactor

A set of extensions to provide caching support on MediatR based request handlers.

something

Installing Cacheable

You should install Cacheable with NuGet:

Install-Package Cacheable

This command will download and install Cacheable. Let me know if you have questions!

Using Cacheable

Cacheable requires MediatR and your IoC container of choice. The decorator pattern is used to wrap the IRequestHandler and IAsyncRequestHandler classes with Cacheable implementations that will handle the caching.

With StructureMap

For(typeof(IRequestHandler<,>)).DecorateAllWith(typeof(MemoryCacheRequestHandler<,>));
For(typeof(IAsyncRequestHandler<,>)).DecorateAllWith(typeof(MemoryCacheAsyncRequestHandler<,>));