Simple Injector usage for generic command handler
问题 The interfaces,commands and command handler set up as per instructions in Simpleinjector wiki. public interface ICommand { string Name { get; set; } } public class Command1 : ICommand { public string Name { get; set; } } public class Command2 : ICommand { public string Name { get; set; } } public interface ICommandHandler<TCommand> { void Execute(TCommand Command); } public class Command1Handler : ICommandHandler<Command1> { public void Execute(Command1 Command) { Console.WriteLine(Command