Not easy. If you can somehow create a Ninject context, you can do
Kernel.GetBindings(typeof(IService))
.Where(b => b.GetProvider(context).Type == implementationType)
UPDATE
There is actually an alternative way to do this. When declaring your bindings, you can provide metadata
Kernel.Bind<IService>().To(implementationType)
.WithMetadata("type", implementationType);
Then you can get all the bindings by doing this
Kernel.GetBindings(typeof(IService))
.Where(b => b.Metadata.Get<Type>("type") == implementationType)
Vadim source
share