Ninject + Bind generic repository

I'm trying to Bind a generic IRepository<> interface to my generic Repository<> - however it always return null?

I have tried various things like:

Bind(typeof(IRepository<CustomerModel>)).To(typeof(Repository<CustomerModel>)); 
Bind(typeof(IRepository<>)).To(typeof(Repository<>)); 

However if I pass in a non-generic interface and class then it works like a dream?

48
задан TheBoyan 8 February 2012 в 13:09
поделиться