Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
maikebing committed Jun 19, 2023
1 parent 6c942bf commit fa5c22e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions Source/Extensions/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,12 @@ public static IApplicationBuilder UseAttributeRouting(this IApplicationBuilder a
var interceptor = app.ApplicationServices.GetService<IRouteInvocationInterceptor>();
server.InterceptingPublishAsync += async (args) =>
{
if (interceptor != null)
{
await interceptor.RouteExecuting(args.ClientId, args.ApplicationMessage);
}
try
{
await interceptor?.RouteExecuting(args.ClientId, args.ApplicationMessage);
await router.OnIncomingApplicationMessage(app.ApplicationServices, args, allowUnmatchedRoutes);
await interceptor?.RouteExecuted(args, null);
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/MQTTnet.AspNetCore.Routing.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>
This is a support library to integrate AttributeRouting into MQTTnet with AspNetCore.
Expand Down

0 comments on commit fa5c22e

Please sign in to comment.