| | | 1 | | using CShells.Features; |
| | | 2 | | using Elsa.Caching.Services; |
| | | 3 | | using Elsa.Platform.PackageManifest.Generator.Hints; |
| | | 4 | | using JetBrains.Annotations; |
| | | 5 | | using Microsoft.Extensions.DependencyInjection; |
| | | 6 | | |
| | | 7 | | namespace Elsa.Caching.ShellFeatures; |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// Configures the MemoryCache. |
| | | 11 | | /// </summary> |
| | | 12 | | [ManifestFeatureCategory("Caching")] |
| | | 13 | | [ManifestFeatureCategory("Infrastructure")] |
| | | 14 | | [ShellFeature( |
| | | 15 | | DisplayName = "Memory Cache", |
| | | 16 | | Description = "Provides in-memory caching services")] |
| | | 17 | | [UsedImplicitly] |
| | | 18 | | public class MemoryCacheFeature : IShellFeature |
| | | 19 | | { |
| | | 20 | | public void ConfigureServices(IServiceCollection services) |
| | | 21 | | { |
| | 0 | 22 | | services |
| | 0 | 23 | | .AddMemoryCache() |
| | 0 | 24 | | .AddSingleton<ICacheManager, CacheManager>() |
| | 0 | 25 | | .AddSingleton<IChangeTokenSignalInvoker, ChangeTokenSignalInvoker>() |
| | 0 | 26 | | .AddSingleton<IChangeTokenSignaler, ChangeTokenSignaler>(); |
| | 0 | 27 | | } |
| | | 28 | | } |