I need to bind generic interface with generic implementation using Ninject.Extensions.Xml. The project is .net mvc project. Is there any way to accomplish this ?
The class:
public class JsonProvider<T> : IJsonProvider<T> where T: new()
{
...
}
Xml configuration (Not working):
<bind service="Base.IJsonProvider, Base" to="Base.JsonProvider, Base"
name ="Config"/>
You want to bind open generic types, so this type definition should do the trick: