src/Arcus.Shared/Correlation/WebApi/Extensions/IServiceCollectionExtensions.cs
/// <summary>
/// Adds operation and transaction correlation to the application.
/// </summary>
/// <param name="services">The services collection containing the dependency injection services.</param>
/// <param name="configureOptions">The function to configure additional options how the correlation works.</param>
/// <exception cref="ArgumentNullException">Thrown when the <paramref name="services"/> is <c>null</c>.</exception>
Adds operation and transaction correlation to the application.
Adds operation and transaction correlation to the application .
public static IServiceCollection AddHttpCorrelationFromPoc(
            this IServiceCollection services,
            Action<CorrelationInfoOptions> configureOptions = null)
        {
            Guard.NotNull(services, nameof(services));
            services.AddHttpContextAccessor();
            services.AddCorrelation(
                serviceProvider =>
                {
                    var httpContextAccessor = serviceProvider.GetRequiredService<IHttpContextAccessor>();
                    return new HttpCorrelationInfoAccessor(httpContextAccessor);
                },
                configureOptions);
            services.AddScoped<HttpWithUpstreamApiGatewayCorrelation>();
            return services;
        }
public static IServiceCollection AddHttpCorrelationFromPoc ( this IServiceCollection services , Action < CorrelationInfoOptions > configureOptions = null ) { Guard . NotNull ( services , nameof ( services ) ) ; services . AddHttpContextAccessor ( ) ; services . AddCorrelation ( serviceProvider => { var httpContextAccessor = serviceProvider . GetRequiredService < IHttpContextAccessor > ( ) ; return new HttpCorrelationInfoAccessor ( httpContextAccessor ) ; } , configureOptions ) ; services . AddScoped < HttpWithUpstreamApiGatewayCorrelation > ( ) ; return services ; }
Adds operation and transaction correlation to the application.
Adds operation and transaction correlation to the application .
Thrown when the  is null
Thrown when the is null
IServiceCollection
this
configureOptions
Action<CorrelationInfoOptions>
The function to configure additional options how the correlation works.
The function to configure additional options how the correlation works .
services
The services collection containing the dependency injection services.
The services collection containing the dependency injection services .