This repository was archived by the owner on Jan 3, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Ninject
hmemcpy edited this page Feb 9, 2013
·
10 revisions
Ninject supports registrations (or "bindings") either directly on the IKernel instance (typically, StandardKernel), or via Ninject Modules.
Agent Mulder plugin supports the following binding syntax:
-
Bind/Rebind<TInterface>().To<TType>()- binds theTInterfaceto a concrete typeTType -
Bind/Rebind(typeof(TInterface)).To(typeof(TType))- non generic overloads, same as above -
Bind/Rebind<TType>().ToSelf()- binds the concrete TType to itself.
You can also mix and match between the generic and non-generic overloads.
Open generic types are supported using the non-generic overloads:
Bind(typeof(IRepository<>)).To(typeof(NHRepository<>))
- Ninject v3 syntax
-
Scan()from Ninject.Extensions.Conventions -
Bind<T1...Tn>()- overloads with more than one generic parameter Rebind<T1...Tn>()ToProvider()When*- Convention-based binding (
kernel.Load)