File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed
Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<Project >
33 <PropertyGroup >
4- <Version >3.1 .0</Version >
4+ <Version >4.0 .0</Version >
55 <AssemblyVersion >1.0.0</AssemblyVersion >
66 <LangVersion >preview</LangVersion >
77 <PackageTags >NServiceBus, Handler Ordering</PackageTags >
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<Project Sdk =" Microsoft.NET.Sdk" >
33 <PropertyGroup >
4- <TargetFramework >net9 .0</TargetFramework >
4+ <TargetFramework >net10 .0</TargetFramework >
55 <RootNamespace >NServiceBus.HandlerOrdering</RootNamespace >
66 </PropertyGroup >
77 <ItemGroup >
8- <PackageReference Include =" NServiceBus" Version =" 9.2.7 " />
8+ <PackageReference Include =" NServiceBus" Version =" 10.0.0 " />
99 <PackageReference Include =" ProjectDefaults" Version =" 1.0.170" PrivateAssets =" all" />
1010 </ItemGroup >
1111</Project >
Original file line number Diff line number Diff line change @@ -13,7 +13,18 @@ static void ApplyInterfaceHandlerOrdering(EndpointConfiguration configuration)
1313 {
1414 var handlerDependencies = GetHandlerDependencies ( configuration ) ;
1515 var sorted = new TypeSorter ( handlerDependencies ) . Sorted ;
16- configuration . ExecuteTheseHandlersFirst ( sorted ) ;
16+
17+ var addHandlerMethod = typeof ( EndpointConfiguration ) . GetMethod ( "AddHandler" , BindingFlags . Instance | BindingFlags . Public ) ;
18+ if ( addHandlerMethod == null )
19+ {
20+ throw new ( $ "Could not find 'AddHandler' method on { nameof ( EndpointConfiguration ) } . Raise an issue here https://github.com/NServiceBusExtensions/NServiceBus.HandlerOrdering/issues/new") ;
21+ }
22+
23+ foreach ( var handlerType in sorted )
24+ {
25+ var genericMethod = addHandlerMethod . MakeGenericMethod ( handlerType ) ;
26+ genericMethod . Invoke ( configuration , null ) ;
27+ }
1728 }
1829
1930 static Dictionary < Type , List < Type > > GetHandlerDependencies ( EndpointConfiguration configuration )
Original file line number Diff line number Diff line change 55 <LangVersion >7.1</LangVersion >
66 </PropertyGroup >
77 <ItemGroup >
8- <PackageReference Include =" NServiceBus" Version =" 9.2.7 " />
8+ <PackageReference Include =" NServiceBus" Version =" 10.0.0 " />
99 <ProjectReference Include =" ..\HandlerOrdering\NServiceBus.Community.HandlerOrdering.csproj" />
1010 </ItemGroup >
1111</Project >
You can’t perform that action at this time.
0 commit comments