我正在尝试将通用的IRepository<>接口绑定到我的通用Repository<>上,但它总是返回null?
我尝试了各种方法,例如:
Bind(typeof(IRepository<CustomerModel>)).To(typeof(Repository<CustomerModel>));
Bind(typeof(IRepository<>)).To(typeof(Repository<>));
然而,如果我传入一个非泛型的接口和类,则它就像梦想一样运行?
我正在尝试将通用的IRepository<>接口绑定到我的通用Repository<>上,但它总是返回null?
我尝试了各种方法,例如:
Bind(typeof(IRepository<CustomerModel>)).To(typeof(Repository<CustomerModel>));
Bind(typeof(IRepository<>)).To(typeof(Repository<>));
然而,如果我传入一个非泛型的接口和类,则它就像梦想一样运行?
IRepository<T,U>
),语法会是什么样子?请参见https://dev59.com/3mw15IYBdhLWcg3wO5SX。谢谢。 - Daniel Liuzzi