c# - Ninject generic type xml binding -
i need bind generic interface generic implementation using ninject.extensions.xml. project .net mvc project. there way accomplish ?
the class:
public class jsonprovider<t> : ijsonprovider<t> t: new() { ... } xml configuration (not working):
<bind service="base.ijsonprovider, base" to="base.jsonprovider, base" name ="config"/>
you want bind open generic types, type definition should trick:
<bind service="base.ijsonprovider`1, base" to="base.jsonprovider`1, base" name ="config"/>
Comments
Post a Comment