First version of BFF

This commit is contained in:
2025-06-23 01:55:17 -06:00
parent e8a8af0228
commit 3e8100e1c5
28 changed files with 865 additions and 61 deletions

View File

@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Http;
namespace Core.Inventory.External
{
public sealed class TrackingMechanismExtension(IHttpContextAccessor httpContextAccessor) : DelegatingHandler
{
private readonly IHttpContextAccessor _httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
if (_httpContextAccessor.HttpContext != null)
{
request.Headers.Add("TrackingId", Guid.NewGuid().ToString());
}
return await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
}
}
}