Table of Contents

Class ParameterOverride

Namespace
Unity.Resolution
Assembly
Unity.Abstractions.dll

A ResolverOverride class that lets you override a named parameter passed to a constructor.

public class ParameterOverride : ResolverOverride, IEquatable<ParameterInfo>, IResolve
Inheritance
ParameterOverride
Implements
Inherited Members
Extension Methods

Constructors

ParameterOverride(string, object)

Construct a new ParameterOverride object that will override the given named constructor parameter, and pass the given value.

public ParameterOverride(string parameterName, object parameterValue)

Parameters

parameterName string

Name of the constructor parameter.

parameterValue object

InjectionParameterValue to pass for the constructor.

ParameterOverride(Type, object)

Construct a new ParameterOverride object that will override the given named constructor parameter, and pass the given value.

public ParameterOverride(Type parameterType, object parameterValue)

Parameters

parameterType Type

Type of the parameter.

parameterValue object

Value to pass for the MethodBase.

ParameterOverride(Type, string, object)

Construct a new ParameterOverride object that will override the given named constructor parameter, and pass the given value.

public ParameterOverride(Type parameterType, string parameterName, object parameterValue)

Parameters

parameterType Type

Type of the parameter.

parameterName string

Name of the constructor parameter.

parameterValue object

Value to pass for the MethodBase.

Fields

Value

protected readonly object Value

Field Value

object

Methods

Equals(object)

public override bool Equals(object other)

Parameters

other object

Returns

bool

Equals(ParameterInfo)

public bool Equals(ParameterInfo other)

Parameters

other ParameterInfo

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