Bind<From, To>
, Bind<T>
, Unbind<T>
Bind<ISomething, Something>()
or if you want to self bind the concrete type just do Bind<Something>()
. You can also unbind a type by using Unbind<Something>()
. You can also add named bindings and other configuration by passing in a configuration object (discussed further on).Resolve<T>
, ResolveAll<T>
Resolve<T>()
or if you want all instances matching that type do ResolveAll<T>()
which returns an enumerable of the given type. You can also request an instance of a type with a given name providing you have bound the type with a name, by doing Resolve<ISomething>("something-1")
which would return the implementation of Something
named "something-1".LoadModule<T>
, LoadModule(IDependencyModule)
IDependencyModule
and has a Setup
method which provides you the container to setup your bindings on.Bind
methods an optional configuration object which exposes the current properties.bool
true
will mean that only one instance of this binding should exist, so if you were to do:IEventSystem
in multiple places you will always get back the same instance, which is extremely handy for infrastructure style objects which should act as singletons. If you provide false
as the value it will return a new instance for every resolve request.string
Action<IDependencyContainer, object>
Type || IEnumerable<Type>
object
Func<IDependencyContainer, object>
IDictionary<string, object>
IDictionary<Type, object>
BindingConfiguration
, this can be used by just creating a lambda within the bind method like so: