Skip to content

Commit fa5c22e

Browse files
committed
1 parent 6c942bf commit fa5c22e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Source/Extensions/ServiceCollectionExtensions.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,12 @@ public static IApplicationBuilder UseAttributeRouting(this IApplicationBuilder a
101101
var interceptor = app.ApplicationServices.GetService<IRouteInvocationInterceptor>();
102102
server.InterceptingPublishAsync += async (args) =>
103103
{
104-
if (interceptor != null)
105-
{
106-
await interceptor.RouteExecuting(args.ClientId, args.ApplicationMessage);
107-
}
108104
try
109105
{
106+
await interceptor?.RouteExecuting(args.ClientId, args.ApplicationMessage);
110107
await router.OnIncomingApplicationMessage(app.ApplicationServices, args, allowUnmatchedRoutes);
108+
await interceptor?.RouteExecuted(args, null);
109+
111110
}
112111
catch (Exception ex)
113112
{

Source/MQTTnet.AspNetCore.Routing.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
66
<Description>
77
This is a support library to integrate AttributeRouting into MQTTnet with AspNetCore.

0 commit comments

Comments
 (0)