From 3e517ae4253f81d3964f4865f9d27c8d533fc3b6 Mon Sep 17 00:00:00 2001 From: Alex Macocian Date: Fri, 23 May 2025 15:20:19 +0200 Subject: [PATCH] Reduce context captures --- Net.Sdk.Web.Extensions/Net.Sdk.Web.Extensions.csproj | 2 +- Net.Sdk.Web.Extensions/WebApplicationExtensions.cs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Net.Sdk.Web.Extensions/Net.Sdk.Web.Extensions.csproj b/Net.Sdk.Web.Extensions/Net.Sdk.Web.Extensions.csproj index b2771bb..d7decf2 100644 --- a/Net.Sdk.Web.Extensions/Net.Sdk.Web.Extensions.csproj +++ b/Net.Sdk.Web.Extensions/Net.Sdk.Web.Extensions.csproj @@ -6,7 +6,7 @@ enable Library true - 0.8.7 + 0.8.8 Alexandru Macocian LICENSE true diff --git a/Net.Sdk.Web.Extensions/WebApplicationExtensions.cs b/Net.Sdk.Web.Extensions/WebApplicationExtensions.cs index 230c7cc..3d3aa82 100644 --- a/Net.Sdk.Web.Extensions/WebApplicationExtensions.cs +++ b/Net.Sdk.Web.Extensions/WebApplicationExtensions.cs @@ -34,12 +34,10 @@ public static class WebApplicationExtensions where TWebSocketRoute : WebSocketRouteBase { app.ThrowIfNull(); - return app.MapGet(route, static async context => + return app.MapGet(route, static async (HttpContext context, ILogger logger, TWebSocketRoute route) => { if (context.WebSockets.IsWebSocketRequest) { - var logger = context.RequestServices.GetRequiredService>(); - var route = context.RequestServices.GetRequiredService(); var routeFilters = GetRouteFilters(context).ToList(); var actionContext = new ActionContext(