using Elsa.Caching.Options;
using Elsa.Caching.Services;
using Elsa.Features.Abstractions;
using Elsa.Features.Services;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Caching.Features;
///
/// Configures the MemoryCache.
///
public class MemoryCacheFeature(IModule module) : FeatureBase(module)
{
///
/// A delegate to configure the .
///
public Action CachingOptions { get; set; } = _ => { };
///
public override void Apply()
{
Services.Configure(CachingOptions);
Services
.AddMemoryCache()
.AddSingleton()
.AddSingleton()
.AddSingleton()
;
}
}