using CShells.FastEndpoints.Features; using CShells.Features; using Elsa.Expressions.Options; using Elsa.Extensions; using Elsa.Resilience.Entities; using Elsa.Resilience.Modifiers; using Elsa.Resilience.Options; using Elsa.Resilience.Recorders; using Elsa.Resilience.Serialization; using Elsa.Resilience.StrategySources; using Elsa.Workflows; using Microsoft.Extensions.DependencyInjection; namespace Elsa.Resilience.ShellFeatures; [ShellFeature] public class ResilienceShellFeature : IFastEndpointsShellFeature { public void ConfigureServices(IServiceCollection services) { services.Configure(options => { options.AddTypeAlias>("RetryAttemptRecordList"); }); services.AddOptions(); services .AddSingleton() .AddSingleton() .AddScoped() .AddScoped() .AddScoped() .AddScoped() .AddSingleton(VoidRetryAttemptRecorder.Instance) .AddSingleton(VoidRetryAttemptReader.Instance) .AddScoped() .AddScoped() .AddScoped() .AddHandlersFrom(); // Register transient exception detection infrastructure services .AddSingleton() .AddSingleton(); } }