Currently, I'm implementing the command pattern with ninject doing the following bindings:
kernel.Bind<ICommand<InsertParams>>().To<InsertProductCommand>();
kernel.Bind<ICommand<UpdateParams>>().To<UpdateProductCommand>();
kernel.Bind<ICommand<DeleteParams>>().To<DeleteProductCommand>();
My question is: these definitions and commands can grow over the time. Is there any way to reduce all these bindings to something like 'Bind(typeof(ICommand<>))' so that every interface depending on the generic type is resolved appropriately?
Ex: If I implement a "ValidateProductCommand" which implements "ICommand" the binding is automatically resolved without adding an extra binding.
Thanks.