Loading src/api/Correlation/CorrelationIdAccessor.cs 0 → 100644 +13 −0 Original line number Diff line number Diff line using Cals.Visor.Application; namespace Cals.Visor.Api.Correlation; public class CorrelationIdAccessor : ICorrelationIdAccessor { private readonly IHttpContextAccessor _httpContextAccessor; public CorrelationIdAccessor(IHttpContextAccessor httpContextAccessor) => _httpContextAccessor = httpContextAccessor; public string? CorrelationId => _httpContextAccessor.HttpContext?.Items["CorrelationId"]?.ToString(); } src/api/Program.cs +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ builder.Services.AddHttpContextAccessor(); builder.Services.AddApplication(); builder.Services.AddTransient<ICurrentUser, CurrentUserSource>(); builder.Services.AddTransient<ICorrelationIdAccessor, CorrelationIdAccessor>(); builder.Services.AddInfrastructure(builder.Configuration); // BE SURE TO RE-REGISTER DomainEventsDispatcherNotificationHandlerDecorator //builder.Services.AddApiDocumentation(); Loading src/application/ICorrelationIdAccessor.cs 0 → 100644 +9 −0 Original line number Diff line number Diff line namespace Cals.Visor.Application; /// <summary> /// Interface dealing with a CorrelationId /// </summary> public interface ICorrelationIdAccessor { string? CorrelationId { get; } } Loading
src/api/Correlation/CorrelationIdAccessor.cs 0 → 100644 +13 −0 Original line number Diff line number Diff line using Cals.Visor.Application; namespace Cals.Visor.Api.Correlation; public class CorrelationIdAccessor : ICorrelationIdAccessor { private readonly IHttpContextAccessor _httpContextAccessor; public CorrelationIdAccessor(IHttpContextAccessor httpContextAccessor) => _httpContextAccessor = httpContextAccessor; public string? CorrelationId => _httpContextAccessor.HttpContext?.Items["CorrelationId"]?.ToString(); }
src/api/Program.cs +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ builder.Services.AddHttpContextAccessor(); builder.Services.AddApplication(); builder.Services.AddTransient<ICurrentUser, CurrentUserSource>(); builder.Services.AddTransient<ICorrelationIdAccessor, CorrelationIdAccessor>(); builder.Services.AddInfrastructure(builder.Configuration); // BE SURE TO RE-REGISTER DomainEventsDispatcherNotificationHandlerDecorator //builder.Services.AddApiDocumentation(); Loading
src/application/ICorrelationIdAccessor.cs 0 → 100644 +9 −0 Original line number Diff line number Diff line namespace Cals.Visor.Application; /// <summary> /// Interface dealing with a CorrelationId /// </summary> public interface ICorrelationIdAccessor { string? CorrelationId { get; } }