Once again I think I might be missing the obvious here. I'm looking to do auto binding by conventions. I've been looking at the Ninject.extension.conventions project and the assembly scanner.
What I have is a lot lines that look like the following, that I would like to auto bind:
Bind<ICommandHandler<MyCommand>>().To<MyCommandHandler>();
Bind<ICommandHandler<MyOtherCommand>>().To<MyOtherCommandHander>();
I've tried several variations of:
Kernal.Scan(x => {
x.FromAssemblyContaining<MyCommand>();
x.WhereTypeInheritsFrom(typeof(ICommandHander<>));
x.BindWith(new DefaultBindingGenerator());
});
But there are no instances returned when:
kernel.Get<ICommandHandler<T>>();