SboxSuperuser/Engine/CommandDiscovery/HandlerSignature6.cs

A sealed generic class that validates a command handler signature with six parameters. It checks the MethodDescription return type and attempts to create the appropriate closed delegate (sync returning CommandResult or async returning Task<CommandResult>) to ensure the method can be bound without invoking it.

Reflection
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>>>();
		}
	}
}