From 8bf82dca7766ed026481a5b19b9a78d5ba595042 Mon Sep 17 00:00:00 2001 From: Khavish Anshudass Bhundoo Date: Sun, 19 May 2024 14:07:03 +0400 Subject: [PATCH] fix dependency injection --- .../Middleware/ProtectEndpointMiddleware.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CallMyTrade.Api/Middleware/ProtectEndpointMiddleware.cs b/src/CallMyTrade.Api/Middleware/ProtectEndpointMiddleware.cs index 96b4cf2..1a1f283 100644 --- a/src/CallMyTrade.Api/Middleware/ProtectEndpointMiddleware.cs +++ b/src/CallMyTrade.Api/Middleware/ProtectEndpointMiddleware.cs @@ -2,6 +2,7 @@ using System.Text.Json; using System.Threading.Tasks; using Core.CallMyTrade; +using Light.GuardClauses; using Microsoft.AspNetCore.Http; using Serilog; @@ -20,9 +21,11 @@ public sealed class ProtectEndpointMiddleware "52.32.178.7" ]; - public ProtectEndpointMiddleware(RequestDelegate next) + public ProtectEndpointMiddleware(RequestDelegate next, IDiagnosticContext diagnosticContext) { - _next = next; + _diagnosticContext = diagnosticContext.MustNotBeNull(); + _next = next.MustNotBeNull(); + } public async Task Invoke(HttpContext context)