EI-Image-Viewer-Api/IRaCIS.Core.API/_ServiceExtensions/EasyCachingSetup.cs

19 lines
546 B
C#

using EasyCaching.Core;
using EasyCaching.Interceptor.Castle;
using Microsoft.Extensions.DependencyInjection;
namespace IRaCIS.Core.API
{
public static class EasyCachingSetup
{
public static void AddEasyCachingSetup(this IServiceCollection services)
{
services.AddEasyCaching(options =>
{
options.UseInMemory();
});
services.ConfigureCastleInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultInMemoryName);
}
}
}