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
parameterName
stringName of the constructor parameter.
parameterValue
objectInjectionParameterValue 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
parameterType
TypeType of the parameter.
parameterName
stringName of the constructor parameter.
parameterValue
objectValue to pass for the MethodBase.
Fields
Value
protected readonly object Value
Field Value
Methods
Equals(object)
public override bool Equals(object other)
Parameters
other
object
Returns
Equals(ParameterInfo)
public bool Equals(ParameterInfo other)
Parameters
other
ParameterInfo
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
context
TContextCurrent build context.
Returns
- object
The value for the dependency.
Type Parameters
TContext