Table of Contents

Class IInjectorExtensions

Namespace
Switchboard
Assembly
Switchboard.InjectorLocator.dll

Provides extension methods for the IInjector interface.

public static class IInjectorExtensions
Inheritance
IInjectorExtensions

Methods

TryGet<T>(IInjector, out T)

Attempts to get a type of dependency from an IInjector.

public static bool TryGet<T>(this IInjector injector, out T dependency) where T : class

Parameters

injector IInjector

The IInjector from which to get a dependency.

dependency T

The dependency instance provided.

Returns

bool

Returns true if the output dependency does not equal null.

Type Parameters

T

The type of dependency to get.