Class PropertyOverride
- Namespace
- Unity.Resolution
- Assembly
- Unity.Abstractions.dll
A ResolverOverride that lets you override the value for a specified property.
public class PropertyOverride : ResolverOverride, IEquatable<PropertyInfo>, IResolve
- Inheritance
-
PropertyOverride
- Implements
- Inherited Members
- Extension Methods
Constructors
PropertyOverride(string, object)
Create an instance of PropertyOverride.
public PropertyOverride(string propertyName, object propertyValue)
Parameters
propertyName
stringThe property name.
propertyValue
objectInjectionParameterValue to use for the property.
Fields
Value
protected readonly object Value
Field Value
Methods
Equals(object)
public override bool Equals(object other)
Parameters
other
object
Returns
Equals(PropertyInfo)
public bool Equals(PropertyInfo other)
Parameters
other
PropertyInfo
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