diff --git a/Net.Sdk.Web.Extensions/Net.Sdk.Web.Extensions.csproj b/Net.Sdk.Web.Extensions/Net.Sdk.Web.Extensions.csproj index 29c184a..b2771bb 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.6 + 0.8.7 Alexandru Macocian LICENSE true diff --git a/Net.Sdk.Web.Extensions/WebApplicationExtensions.cs b/Net.Sdk.Web.Extensions/WebApplicationExtensions.cs index f4c229f..230c7cc 100644 --- a/Net.Sdk.Web.Extensions/WebApplicationExtensions.cs +++ b/Net.Sdk.Web.Extensions/WebApplicationExtensions.cs @@ -30,16 +30,16 @@ public static class WebApplicationExtensions return webApplication; } - public static IEndpointConventionBuilder UseWebSocketRoute<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TWebSocketRoute>(this WebApplication app, string route) + public static IEndpointConventionBuilder UseWebSocketRoute(this WebApplication app, string route) where TWebSocketRoute : WebSocketRouteBase { app.ThrowIfNull(); - return app.MapGet(route, async context => + return app.MapGet(route, static async context => { if (context.WebSockets.IsWebSocketRequest) { - var logger = app.Services.GetRequiredService>(); - var route = app.Services.GetRequiredService(); + var logger = context.RequestServices.GetRequiredService>(); + var route = context.RequestServices.GetRequiredService(); var routeFilters = GetRouteFilters(context).ToList(); var actionContext = new ActionContext(