Class ParameterOverride
- Namespace
- Unity.Resolution
- Assembly
- Unity.Abstractions.dll
A ResolverOverride class that lets you override a named parameter passed to a constructor.
public class ParameterOverride : ResolverOverride, IEquatable<ParameterInfo>, IResolve
- Inheritance
-
ParameterOverride
- Implements
- Inherited Members
- Extension Methods
Constructors
ParameterOverride(string, object)
Construct a new ParameterOverride object that will override the given named constructor parameter, and pass the given value.
public ParameterOverride(string parameterName, object parameterValue)
Parameters
parameterNamestringName of the constructor parameter.
parameterValueobjectInjectionParameterValue to pass for the constructor.
ParameterOverride(Type, object)
Construct a new ParameterOverride object that will override the given named constructor parameter, and pass the given value.
public ParameterOverride(Type parameterType, object parameterValue)
Parameters
ParameterOverride(Type, string, object)
Construct a new ParameterOverride object that will override the given named constructor parameter, and pass the given value.
public ParameterOverride(Type parameterType, string parameterName, object parameterValue)
Parameters
parameterTypeTypeType of the parameter.
parameterNamestringName of the constructor parameter.
parameterValueobjectValue to pass for the MethodBase.
Fields
Value
protected readonly object Value
Field Value
Methods
Equals(object)
public override bool Equals(object other)
Parameters
otherobject
Returns
Equals(ParameterInfo)
public bool Equals(ParameterInfo other)
Parameters
otherParameterInfo
Returns
GetHashCode()
public override int GetHashCode()
Returns
Resolve<TContext>(ref TContext)
GetOrDefault the value
public object Resolve<TContext>(ref TContext context) where TContext : IResolveContext
Parameters
contextTContextCurrent build context.
Returns
- object
The value for the dependency.
Type Parameters
TContext