How to bind Generic-type interfaces in Ninject
问题 I'm fairly new to Ninject, and found myself stumbling when I came to implement a generic repository pattern. I want to bind a dependency IRepository<IEntityType> to a class ConcreteRepository<EntityType> where ConcreteRepository<T> implements IRepository<T> and EntityType implements IEntityType. I tried this: kernel.Bind<IRepository<IEntityType>>().To<ConcreteRepository<EntityType>>(); ...but Ninject won't take that because it doesn't know or care that EntityType implements IEntityType. How