Class InjectionFactory
Base class for objects that can be used to configure what class members get injected by the container.
[Obsolete("InjectionFactory has been deprecated and will be removed in next release. Please use IUnityContainer.RegisterFactory(...) method instead.", false)]
public class InjectionFactory : InjectionMember
- Inheritance
-
InjectionFactory
- Inherited Members
- Extension Methods
Remarks
This factory allow using predefined
Func<IUnityContainer, Type, string, object>
to create types.
Constructors
InjectionFactory(Func<IUnityContainer, object>)
Create a new instance of InjectionFactory with the given factory function.
public InjectionFactory(Func<IUnityContainer, object> factoryFunc)
Parameters
factoryFunc
Func<IUnityContainer, object>Factory function.
InjectionFactory(Func<IUnityContainer, Type, string, object>)
Create a new instance of InjectionFactory with the given factory function.
public InjectionFactory(Func<IUnityContainer, Type, string, object> factoryFunc)
Parameters
factoryFunc
Func<IUnityContainer, Type, string, object>Factory function.
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 override 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. This parameter is ignored in this implementation.
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