You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewInvalidOperationException($"Method's command parameter is not a reference type, only reference type commands are supported. {createCheckMethodMessage(methodInfo)}.");
46
+
}
47
+
48
+
// Set command type.
49
+
commandType=commandParameter.ParameterType;
50
+
}
51
+
else
52
+
{
53
+
// Method has no parameter.
54
+
thrownewInvalidOperationException($"Method must accept a command object as a parameter. {createCheckMethodMessage(methodInfo)}.");
// throw new InvalidOperationException($"Methods with async void signatures are not allowed. A Task may be used as return type instead of void. Check method: {methodInfo.ToString()}.");
69
+
// }
70
+
}
71
+
else
72
+
{
73
+
// Return type is not Task/void. Invalid.
74
+
thrownewInvalidOperationException($"Method marked with [CommandHandler] can only have void or a Task as return value. {createCheckMethodMessage(methodInfo)}.");
thrownewInvalidOperationException($"Cancellation token support is only available for async methods (methods returning a Task). {createCheckMethodMessage(methodInfo)}.");
/// Detect methods marked with [CommandHandler] attribute and translate to CommandHandlerAttributeMethod instances.
153
+
/// </summary>
154
+
/// <param name="commandHandlerAssembly">Assembly to scan for methods marked with the [CommandHandler] attribute.</param>
155
+
/// <param name="instanceFactory">Factory delegate that provides an instance of a type that has methods marked with [CommandHandler] attribute.</param>
156
+
/// <returns>List of all CommandHandlerAttributeMethod detected.</returns>
/// Detect methods marked with [CommandHandler] attribute and translate to CommandHandlerAttributeMethod instances.
174
+
/// </summary>
175
+
/// <param name="commandHandlerAssemblies">Assemblies to scan for methods marked with the [CommandHandler] attribute.</param>
176
+
/// <param name="instanceFactory">Factory delegate that provides an instance of a type that has methods marked with [CommandHandler] attribute.</param>
177
+
/// <returns>List of all CommandHandlerAttributeMethod detected.</returns>
0 commit comments