@@ -33,11 +33,11 @@ public static partial class SingleMessageHandlerRegistrationExtensions
3333 /// </remarks>
3434 /// <param name="registration">Message handler registration.</param>
3535 /// <param name="attributedObjectFactory">Factory delegate which provides an instance of a class that contains methods marked with [CommandHandler] attribute.</param>
36- public static void RegisterCommandHandlerAttributes < TAttributed > ( this SingleMessageHandlerRegistration registration ,
37- Func < TAttributed > attributedObjectFactory )
38- where TAttributed : class
36+ public static void RegisterCommandHandlersByAttribute < TAttributed > ( this SingleMessageHandlerRegistration registration ,
37+ Func < TAttributed > attributedObjectFactory )
38+ where TAttributed : class
3939 {
40- RegisterCommandHandlerAttributes ( registration , CommandHandlerAttributeMethod . FromType < TAttributed > ( attributedObjectFactory ) ) ;
40+ RegisterCommandHandlersByAttribute ( registration , CommandHandlerAttributeMethod . FromType < TAttributed > ( attributedObjectFactory ) ) ;
4141 }
4242
4343 /// <summary>
@@ -50,11 +50,11 @@ public static void RegisterCommandHandlerAttributes<TAttributed>(this SingleMess
5050 /// <param name="registration">Message handler registration.</param>
5151 /// <param name="type">Type to scan for methods marked with the [CommandHandler] attribute.</param>
5252 /// <param name="instanceFactory">Factory delegate that provides an instance of the specified type.</param>
53- public static void RegisterCommandHandlerAttributes ( this SingleMessageHandlerRegistration registration ,
54- Type type ,
55- Func < object > instanceFactory )
53+ public static void RegisterCommandHandlersByAttribute ( this SingleMessageHandlerRegistration registration ,
54+ Type type ,
55+ Func < object > instanceFactory )
5656 {
57- RegisterCommandHandlerAttributes ( registration , CommandHandlerAttributeMethod . FromType ( type , instanceFactory ) ) ;
57+ RegisterCommandHandlersByAttribute ( registration , CommandHandlerAttributeMethod . FromType ( type , instanceFactory ) ) ;
5858 }
5959
6060 /// <summary>
@@ -67,11 +67,11 @@ public static void RegisterCommandHandlerAttributes(this SingleMessageHandlerReg
6767 /// <param name="registration">Message handler registration.</param>
6868 /// <param name="types">Types to scan for methods marked with the [CommandHandler] attribute.</param>
6969 /// <param name="instanceFactory">Factory delegate that provides an instance of a given type.</param>
70- public static void RegisterCommandHandlerAttributes ( this SingleMessageHandlerRegistration registration ,
71- IEnumerable < Type > types ,
72- Func < Type , object > instanceFactory )
70+ public static void RegisterCommandHandlersByAttribute ( this SingleMessageHandlerRegistration registration ,
71+ IEnumerable < Type > types ,
72+ Func < Type , object > instanceFactory )
7373 {
74- RegisterCommandHandlerAttributes ( registration , CommandHandlerAttributeMethod . FromTypes ( types , instanceFactory ) ) ;
74+ RegisterCommandHandlersByAttribute ( registration , CommandHandlerAttributeMethod . FromTypes ( types , instanceFactory ) ) ;
7575 }
7676
7777 /// <summary>
@@ -84,11 +84,11 @@ public static void RegisterCommandHandlerAttributes(this SingleMessageHandlerReg
8484 /// <param name="registration">Message handler registration.</param>
8585 /// <param name="assembly">Assembly to scan for methods marked with the [CommandHandler] attribute.</param>
8686 /// <param name="instanceFactory">Factory delegate that provides an instance of a type that has methods marked with [CommandHandler] attribute.</param>
87- public static void RegisterCommandHandlerAttributes ( this SingleMessageHandlerRegistration registration ,
88- Assembly assembly ,
89- Func < Type , object > instanceFactory )
87+ public static void RegisterCommandHandlersByAttribute ( this SingleMessageHandlerRegistration registration ,
88+ Assembly assembly ,
89+ Func < Type , object > instanceFactory )
9090 {
91- RegisterCommandHandlerAttributes ( registration , CommandHandlerAttributeMethod . FromAssembly ( assembly , instanceFactory ) ) ;
91+ RegisterCommandHandlersByAttribute ( registration , CommandHandlerAttributeMethod . FromAssembly ( assembly , instanceFactory ) ) ;
9292 }
9393
9494 /// <summary>
@@ -101,26 +101,11 @@ public static void RegisterCommandHandlerAttributes(this SingleMessageHandlerReg
101101 /// <param name="registration">Message handler registration.</param>
102102 /// <param name="assembly">Assembly to scan for methods marked with the [CommandHandler] attribute.</param>
103103 /// <param name="instanceFactory">Factory delegate that provides an instance of a type that has methods marked with [CommandHandler] attribute.</param>
104- public static void RegisterCommandHandlerAttributes ( this SingleMessageHandlerRegistration registration ,
105- IEnumerable < Assembly > assemblies ,
106- Func < Type , object > instanceFactory )
104+ public static void RegisterCommandHandlersByAttribute ( this SingleMessageHandlerRegistration registration ,
105+ IEnumerable < Assembly > assemblies ,
106+ Func < Type , object > instanceFactory )
107107 {
108- RegisterCommandHandlerAttributes ( registration , CommandHandlerAttributeMethod . FromAssemblies ( assemblies , instanceFactory ) ) ;
109- }
110-
111- /// <summary>
112- /// Register methods marked with the [CommandHandler] attribute as command handlers.
113- /// <para>Supported signatures for methods marked with [CommandHandler] are: (Methods can be named differently)</para>
114- /// <para>void HandleCommand(TCommand command);</para>
115- /// <para>Task HandleCommandAsync(TCommand command);</para>
116- /// <para>Task HandleCommandAsync(TCommand command, CancellationToken cancellationToken);</para>
117- /// </summary>
118- /// <param name="registration">Message handler registration.</param>
119- /// <param name="commandHandlerMethod">Object which represents a method marked with [CommandHandler] attribute.</param>
120- public static void RegisterCommandHandlerAttributes ( this SingleMessageHandlerRegistration registration ,
121- CommandHandlerAttributeMethod commandHandlerMethod )
122- {
123- RegisterCommandHandlerAttributes ( registration , new [ ] { commandHandlerMethod } ) ;
108+ RegisterCommandHandlersByAttribute ( registration , CommandHandlerAttributeMethod . FromAssemblies ( assemblies , instanceFactory ) ) ;
124109 }
125110
126111 /// <summary>
@@ -132,8 +117,8 @@ public static void RegisterCommandHandlerAttributes(this SingleMessageHandlerReg
132117 /// </summary>
133118 /// <param name="registration">Message handler registration.</param>
134119 /// <param name="commandHandlerMethods">Objects which represent methods marked with [CommandHandler] attribute.</param>
135- public static void RegisterCommandHandlerAttributes ( this SingleMessageHandlerRegistration registration ,
136- IEnumerable < CommandHandlerAttributeMethod > commandHandlerMethods )
120+ public static void RegisterCommandHandlersByAttribute ( this SingleMessageHandlerRegistration registration ,
121+ IEnumerable < CommandHandlerAttributeMethod > commandHandlerMethods )
137122 {
138123 if ( registration == null )
139124 {
0 commit comments