Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 1.4 KB

File metadata and controls

33 lines (21 loc) · 1.4 KB

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<,>));