namespace ProfitGroup.NotifyService.Core.Handlers;

public class RequestScopedLoggerMiddleware
{
    private readonly RequestDelegate _next;

    public RequestScopedLoggerMiddleware(RequestDelegate next)
    {
        _next = next;
    }

    [Obsolete("Obsolete")]
    public async Task Invoke(HttpContext context)
    {
        var requestGuid = Guid.NewGuid();

        NLog.MappedDiagnosticsContext.Set("RequestGuid", requestGuid.ToString());

        await _next(context);
    }
}