, . Ninject .
,
ProductController IProductService
IProductService ProductService, IProductRepository
IProductRepository NHibernateProductRepository, ISession.
when your NinjectControllerFactorytrying to resolve ProductController, he sees a dependency on IProductService. he solves this dependence as ProductServicehe sees that it has a dependence on IProductRepository. and he will continue to move down the chain until he can fully resolve the dispute.
therefore, an important part is the binding of ANY dependencies, and not just to the controller.
source
share