Table of Contents

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

name string
dependencyValue object

DependencyOverride(Type, object)

Create an instance of DependencyOverride to override the given type with the given value.

public DependencyOverride(Type typeToConstruct, object dependencyValue)

Parameters

typeToConstruct Type

Type of the dependency.

dependencyValue object

InjectionParameterValue to use.

DependencyOverride(Type, string, object)

public DependencyOverride(Type type, string name, object value)

Parameters

type Type
name string
value object

DependencyOverride(Type, Type, string, object)

public DependencyOverride(Type target, Type type, string name, object value)

Parameters

target Type
type Type
name string
value object

Fields

Value

protected readonly object Value

Field Value

object

Methods

Equals(object)

public override bool Equals(object other)

Parameters

other object

Returns

bool

Equals(NamedType)

public bool Equals(NamedType other)

Parameters

other NamedType

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Resolve<TContext>(ref TContext)

GetOrDefault the value

public object Resolve<TContext>(ref TContext context) where TContext : IResolveContext

Parameters

context TContext

Current build context.

Returns

object

The value for the dependency.

Type Parameters

TContext