Show / Hide Table of Contents

Class ParameterOverride

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

Inheritance
Object
ResolverOverride
ParameterOverride
Implements
IEquatable<ParameterInfo>
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 ParameterOverride : ResolverOverride, IEquatable<ParameterInfo>, IResolve

Constructors

| Improve this Doc View Source

ParameterOverride(String, Object)

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

Declaration
public ParameterOverride(string parameterName, object parameterValue)
Parameters
Type Name Description
String parameterName

Name of the constructor parameter.

Object parameterValue

InjectionParameterValue to pass for the constructor.

| Improve this Doc View Source

ParameterOverride(Type, Object)

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

Declaration
public ParameterOverride(Type parameterType, object parameterValue)
Parameters
Type Name Description
Type parameterType

Type of the parameter.

Object parameterValue

Value to pass for the MethodBase.

| Improve this Doc View Source

ParameterOverride(Type, String, Object)

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

Declaration
public ParameterOverride(Type parameterType, string parameterName, object parameterValue)
Parameters
Type Name Description
Type parameterType

Type of the parameter.

String parameterName

Name of the constructor parameter.

Object parameterValue

Value to pass for the MethodBase.

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(ParameterInfo)

Declaration
public bool Equals(ParameterInfo other)
Parameters
Type Name Description
ParameterInfo 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