Class InjectionMember
Base class for objects that can be used to configure what class members get injected by the container.
public abstract class InjectionMember
- Inheritance
-
InjectionMember
- Derived
- Inherited Members
- Extension Methods
Properties
BuildRequired
This injection member instructs engine, when type mapping is present, to build type instead of resolving it
public virtual bool BuildRequired { get; }
Property Value
Remarks
When types registered like this:
Line 1: container.RegisterType{OtherService}(new ContainerControlledLifetimeManager());
Line 2: container.RegisterType{IService, OtherService}();
Line 3: container.RegisterType{IOtherService, OtherService}(new InjectionConstructor(container));
It is expected that IService resolves instance registered on line 1. But when IOtherService is resolved it requires different constructor so it should be built instead.
Methods
AddPolicies<TContext, TPolicySet>(Type, Type, string, ref TPolicySet)
Add policies to the policies
to configure the
container to call this constructor with the appropriate parameter values.
public virtual void AddPolicies<TContext, TPolicySet>(Type registeredType, Type mappedToType, string name, ref TPolicySet policies) where TContext : IResolveContext where TPolicySet : IPolicySet
Parameters
registeredType
TypeType of interface being registered. If no interface, this will be null.
mappedToType
TypeType of concrete type being registered.
name
stringName used to resolve the type object.
policies
TPolicySetPolicy list to add policies to.
Type Parameters
TContext
TPolicySet