September 2013
Intermediate to advanced
142 pages
2h 58m
English
It is not difficult to register a few service types, one by one in a small application. But what about a production application with hundreds of services which should be wired to their implementations?
Convention-based configuration allows us to bind a group of services using a convention rather than defining individual bindings for each of them. For example, you can simply ask Ninject to bind all components to their base interfaces like this:
kernel.Bind(r => r .FromThisAssembly() .SelectAllClasses() .BindAllInterfaces());
In order to take advantage of the Convention based configuration, we should add refererence to the Ninject's Conventions extension. We can either use NuGet to install Ninject.Extensions.Conventions ...
Read now
Unlock full access