Show / Hide Table of Contents

Class ParameterOverrides

A convenience form of ParameterOverride that lets you specify multiple parameter overrides in one shot rather than having to construct multiple objects.

Inheritance
Object
ParameterOverrides
Implements
IEnumerable
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Unity.Resolution
Assembly: Unity.Abstractions.dll
Syntax
public class ParameterOverrides : IEnumerable

Methods

| Improve this Doc View Source

Add(String, Object)

Add a new override to the collection with the given key and value.

Declaration
public void Add(string key, object value)
Parameters
Type Name Description
String key

Key - for example, a parameter or property name.

Object value

InjectionParameterValue - the value to be returned by the override.

| Improve this Doc View Source

GetEnumerator()

Declaration
public IEnumerator GetEnumerator()
Returns
Type Description
IEnumerator
| Improve this Doc View Source

OnType(Type)

Wrap this resolver in one that verifies the type of the object being built. This allows you to narrow any override down to a specific type easily.

Declaration
public ResolverOverride[] OnType(Type targetType)
Parameters
Type Name Description
Type targetType

Type to constrain the override to.

Returns
Type Description
ResolverOverride[]

The new override.

| Improve this Doc View Source

OnType<T>()

Wrap this resolver in one that verifies the type of the object being built. This allows you to narrow any override down to a specific type easily.

Declaration
public ResolverOverride[] OnType<T>()
Returns
Type Description
ResolverOverride[]

The new override.

Type Parameters
Name Description
T

Type to constrain the override to.

Implements

System.Collections.IEnumerable

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