Class InjectionMember<TMemberInfo, TData>
public abstract class InjectionMember<TMemberInfo, TData> : InjectionMember, IEquatable<TMemberInfo> where TMemberInfo : MemberInfo
Type Parameters
TMemberInfo
TData
- Inheritance
-
InjectionMember<TMemberInfo, TData>
- Implements
-
IEquatable<TMemberInfo>
- Derived
- Inherited Members
- Extension Methods
Constructors
InjectionMember(string, TData)
protected InjectionMember(string name, TData data)
Parameters
name
stringdata
TData
InjectionMember(TMemberInfo, TData)
protected InjectionMember(TMemberInfo info, TData data)
Parameters
info
TMemberInfodata
TData
Fields
NoMatchFound
protected const string NoMatchFound = "No member matching data has been found."
Field Value
Properties
BuildRequired
This injection member instructs engine, when type mapping is present, to build type instead of resolving it
public override 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.
Data
public virtual TData Data { get; }
Property Value
- TData
IsInitialized
public bool IsInitialized { get; }
Property Value
Name
public string Name { get; }
Property Value
Selection
protected TMemberInfo Selection { get; set; }
Property Value
- TMemberInfo
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.
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
DeclaredMembers(Type)
public abstract IEnumerable<TMemberInfo> DeclaredMembers(Type type)
Parameters
type
Type
Returns
- IEnumerable<TMemberInfo>
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
Equals(TMemberInfo)
public virtual bool Equals(TMemberInfo other)
Parameters
other
TMemberInfo
Returns
GetHashCode()
public override int GetHashCode()
Returns
MemberInfo(Type)
public abstract TMemberInfo MemberInfo(Type type)
Parameters
type
Type
Returns
- TMemberInfo
SelectMember(Type, InjectionMember)
protected virtual TMemberInfo SelectMember(Type type, InjectionMember member)
Parameters
type
Typemember
InjectionMember
Returns
- TMemberInfo