A handler signature validator for command methods that take six typed parameters. It checks that a Sandbox.MethodDescription can be bound to either a Func<T1..T6, CommandResult> or a Func<T1..T6, Task<CommandResult>> delegate, based on the method's return type, without invoking the handler.
namespace SboxSuperuser.Engine.CommandDiscovery;
internal sealed class HandlerSignature6<T1, T2, T3, T4, T5, T6> : IHandlerSignature
{
/// <summary>Checks closed delegate binding without executing the handler.</summary>
public void Validate( Sandbox.MethodDescription method )
{
if ( method.ReturnType == typeof( CommandResult ) )
{
_ = method.CreateDelegate<Func<T1, T2, T3, T4, T5, T6, CommandResult>>();
}
else
{
_ = method.CreateDelegate<Func<T1, T2, T3, T4, T5, T6, Task<CommandResult>>>();
}
}
}