Ninject modules

As our application grows, the list of service registrations gets longer, and it would be difficult to manage this list. Ninject modules are a good way to segregate our type bindings into distinct groups of bindings, which can be easily organized into separate files. Minimum requirement for a class to be accepted as a Ninject module is to implement the INinjectModule interface. Implementing this interface requires us to implement three methods and two properties each time we need to create a module. It is a good idea to implement this interface as an abstract class once, and extend it whenever we need to create a Ninject module. The good news is that Ninject has already implemented this abstract class, which is named NinjectModule ...

Get Mastering Ninject for Dependency Injection now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.