Reduce context captures

This commit is contained in:
2025-05-23 15:20:19 +02:00
parent a458238f05
commit 3e517ae425
2 changed files with 2 additions and 4 deletions
@@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<Version>0.8.7</Version>
<Version>0.8.8</Version>
<Authors>Alexandru Macocian</Authors>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
@@ -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<TWebSocketRoute> logger, TWebSocketRoute route) =>
{
if (context.WebSockets.IsWebSocketRequest)
{
var logger = context.RequestServices.GetRequiredService<ILogger<TWebSocketRoute>>();
var route = context.RequestServices.GetRequiredService<TWebSocketRoute>();
var routeFilters = GetRouteFilters<TWebSocketRoute>(context).ToList();
var actionContext = new ActionContext(