Class DependencyOverride
- Namespace
 - Unity.Resolution
 
- Assembly
 - Unity.Abstractions.dll
 
A ResolverOverride class that overrides the value injected whenever there is a dependency of the given type, regardless of where it appears in the object graph.
public class DependencyOverride : ResolverOverride, IEquatable<NamedType>, IResolve
  - Inheritance
 - 
      
      
      DependencyOverride
 
- Implements
 
- Derived
 
- Inherited Members
 
- Extension Methods
 
Constructors
DependencyOverride(string, object)
public DependencyOverride(string name, object dependencyValue)
  Parameters
DependencyOverride(Type, object)
Create an instance of DependencyOverride to override the given type with the given value.
public DependencyOverride(Type typeToConstruct, object dependencyValue)
  Parameters
DependencyOverride(Type, string, object)
public DependencyOverride(Type type, string name, object value)
  Parameters
DependencyOverride(Type, Type, string, object)
public DependencyOverride(Type target, Type type, string name, object value)
  Parameters
Fields
Value
protected readonly object Value
  Field Value
Methods
Equals(object)
public override bool Equals(object other)
  Parameters
otherobject
Returns
Equals(NamedType)
public bool Equals(NamedType other)
  Parameters
otherNamedType
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