Skip to content

Commit 3e517ae

Browse files
committed
Reduce context captures
1 parent a458238 commit 3e517ae

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Net.Sdk.Web.Extensions/Net.Sdk.Web.Extensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Nullable>enable</Nullable>
77
<OutputType>Library</OutputType>
88
<IsPackable>true</IsPackable>
9-
<Version>0.8.7</Version>
9+
<Version>0.8.8</Version>
1010
<Authors>Alexandru Macocian</Authors>
1111
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1212
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>

Net.Sdk.Web.Extensions/WebApplicationExtensions.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ public static IEndpointConventionBuilder UseWebSocketRoute<TWebSocketRoute>(this
3434
where TWebSocketRoute : WebSocketRouteBase
3535
{
3636
app.ThrowIfNull();
37-
return app.MapGet(route, static async context =>
37+
return app.MapGet(route, static async (HttpContext context, ILogger<TWebSocketRoute> logger, TWebSocketRoute route) =>
3838
{
3939
if (context.WebSockets.IsWebSocketRequest)
4040
{
41-
var logger = context.RequestServices.GetRequiredService<ILogger<TWebSocketRoute>>();
42-
var route = context.RequestServices.GetRequiredService<TWebSocketRoute>();
4341
var routeFilters = GetRouteFilters<TWebSocketRoute>(context).ToList();
4442

4543
var actionContext = new ActionContext(

0 commit comments

Comments
 (0)