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
propertyNamestringThe property name.
propertyValueobjectInjectionParameterValue to use for the property.
Fields
Value
protected readonly object Value
Field Value
Methods
Equals(object)
public override bool Equals(object other)
Parameters
otherobject
Returns
Equals(PropertyInfo)
public bool Equals(PropertyInfo other)
Parameters
otherPropertyInfo
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