Interface IBinding
IBinding allows mapping of a contract type contractType to an
IProvider that provides the dependency for the type. It contains extra information that enables
the IResolver to locate the correct IBinding and IProvider.
IBinding also contains convenient methods that allow us to chain method calls.
container.Bind<IEventService>().To<EventService>().AsSingle().Conclude();
Assembly: cs.temp.dll.dll
Syntax
public interface IBinding
Properties
contractType
Declaration
Type contractType { get; }
Property Value
id
An optional id field so we can have different bindings with the same contractType.
Declaration
Property Value
lifestyle
Declaration
Lifestyle lifestyle { get; }
Property Value
provider
The IProvider of the dependency for this contract.
Declaration
IProvider provider { get; }
Property Value
Methods
AsCached()
Declaration
Returns
AsSingleton()
Declaration
Returns
AsTransient()
Declaration
Returns
Conclude()
Declaration
Returns
FromMethod<TConcrete>(Func<TConcrete>)
Declaration
IBinding FromMethod<TConcrete>(Func<TConcrete> method)
where TConcrete : class
Parameters
Type |
Name |
Description |
Func<TConcrete> |
method |
|
Returns
Type Parameters
Name |
Description |
TConcrete |
|
FromProvider(IProvider)
Declaration
IBinding FromProvider(IProvider newProvider)
Parameters
Returns
To<TConcrete>()
Declaration
IBinding To<TConcrete>()
where TConcrete : class
Returns
Type Parameters
Name |
Description |
TConcrete |
|
ToId(Object)
Declaration
Parameters
Type |
Name |
Description |
Object |
id |
|
Returns
ToInstance(Object)
Declaration
IBinding ToInstance(object instance)
Parameters
Type |
Name |
Description |
Object |
instance |
|
Returns