Table of Contents

Class FieldOverride

Namespace
Unity.Resolution
Assembly
Unity.Abstractions.dll

A ResolverOverride that lets you override the value for a specified field.

public class FieldOverride : ResolverOverride, IEquatable<FieldInfo>, IResolve
Inheritance
FieldOverride
Implements
Inherited Members
Extension Methods

Constructors

FieldOverride(string, object)

Create an instance of FieldOverride.

public FieldOverride(string fieldName, object fieldValue)

Parameters

fieldName string

The Field name.

fieldValue object

InjectionParameterValue to use for the Field.

Fields

Value

protected readonly object Value

Field Value

object

Methods

Equals(object)

public override bool Equals(object other)

Parameters

other object

Returns

bool

Equals(FieldInfo)

public bool Equals(FieldInfo other)

Parameters

other FieldInfo

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