Table of Contents

Class ParameterOverrides

Namespace
Unity.Resolution
Assembly
Unity.Abstractions.dll

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

public class ParameterOverrides : IEnumerable
Inheritance
ParameterOverrides
Implements
Inherited Members
Extension Methods

Methods

Add(string, object)

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

public void Add(string key, object value)

Parameters

key string

Key - for example, a parameter or property name.

value object

InjectionParameterValue - the value to be returned by the override.

GetEnumerator()

public IEnumerator GetEnumerator()

Returns

IEnumerator

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.

public ResolverOverride[] OnType(Type targetType)

Parameters

targetType Type

Type to constrain the override to.

Returns

ResolverOverride[]

The new override.

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.

public ResolverOverride[] OnType<T>()

Returns

ResolverOverride[]

The new override.

Type Parameters

T

Type to constrain the override to.