Show / Hide Table of Contents

Class DependencyOverride

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.

Inheritance
Object
ResolverOverride
DependencyOverride
DependencyOverride<T>
Implements
IEquatable<NamedType>
IResolve
Inherited Members
ResolverOverride.Target
ResolverOverride.Type
ResolverOverride.Name
ResolverOverride.OnType<T>()
ResolverOverride.OnType(Type)
ResolverOverride.GetResolver<TContext>(Type)
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Unity.Resolution
Assembly: Unity.Abstractions.dll
Syntax
public class DependencyOverride : ResolverOverride, IEquatable<NamedType>, IResolve

Constructors

| Improve this Doc View Source

DependencyOverride(String, Object)

Declaration
public DependencyOverride(string name, object dependencyValue)
Parameters
Type Name Description
String name
Object dependencyValue
| Improve this Doc View Source

DependencyOverride(Type, Object)

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

Declaration
public DependencyOverride(Type typeToConstruct, object dependencyValue)
Parameters
Type Name Description
Type typeToConstruct

Type of the dependency.

Object dependencyValue

InjectionParameterValue to use.

| Improve this Doc View Source

DependencyOverride(Type, String, Object)

Declaration
public DependencyOverride(Type type, string name, object value)
Parameters
Type Name Description
Type type
String name
Object value
| Improve this Doc View Source

DependencyOverride(Type, Type, String, Object)

Declaration
public DependencyOverride(Type target, Type type, string name, object value)
Parameters
Type Name Description
Type target
Type type
String name
Object value

Fields

| Improve this Doc View Source

Value

Declaration
protected readonly object Value
Field Value
Type Description
Object

Methods

| Improve this Doc View Source

Equals(Object)

Declaration
public override bool Equals(object other)
Parameters
Type Name Description
Object other
Returns
Type Description
Boolean
Overrides
ResolverOverride.Equals(Object)
| Improve this Doc View Source

Equals(NamedType)

Declaration
public bool Equals(NamedType other)
Parameters
Type Name Description
NamedType other
Returns
Type Description
Boolean
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32
Overrides
ResolverOverride.GetHashCode()
| Improve this Doc View Source

Resolve<TContext>(ref TContext)

Declaration
public object Resolve<TContext>(ref TContext context)
    where TContext : IResolveContext
Parameters
Type Name Description
TContext context
Returns
Type Description
Object
Type Parameters
Name Description
TContext

Implements

System.IEquatable<T>
IResolve

Extension Methods

InjectionMatching.Matches(Object, Type)
InjectionMatching.MatchesObject(Object, Type)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2020 .NET Foundation and Contributors. All Rights Reserved