Share via


SingletonDependencyResolver<T> Constructors

Definition

Overloads

SingletonDependencyResolver<T>(T)

Constructs a new resolver that will return the given instance for the contract type regardless of the key passed to the Get method.

SingletonDependencyResolver<T>(T, Func<Object,Boolean>)

Constructs a new resolver that will return the given instance for the contract type if the given key matches the key passed to the Get method based on the given predicate.

SingletonDependencyResolver<T>(T, Object)

Constructs a new resolver that will return the given instance for the contract type if the given key matches exactly the key passed to the Get method.

SingletonDependencyResolver<T>(T)

Constructs a new resolver that will return the given instance for the contract type regardless of the key passed to the Get method.

public SingletonDependencyResolver (T singletonInstance);
new System.Data.Entity.Infrastructure.DependencyResolution.SingletonDependencyResolver<'T (requires 'T : null)> : 'T -> System.Data.Entity.Infrastructure.DependencyResolution.SingletonDependencyResolver<'T (requires 'T : null)>
Public Sub New (singletonInstance As T)

Parameters

singletonInstance
T

The instance to return.

Applies to

SingletonDependencyResolver<T>(T, Func<Object,Boolean>)

Constructs a new resolver that will return the given instance for the contract type if the given key matches the key passed to the Get method based on the given predicate.

public SingletonDependencyResolver (T singletonInstance, Func<object,bool> keyPredicate);
new System.Data.Entity.Infrastructure.DependencyResolution.SingletonDependencyResolver<'T (requires 'T : null)> : 'T * Func<obj, bool> -> System.Data.Entity.Infrastructure.DependencyResolution.SingletonDependencyResolver<'T (requires 'T : null)>
Public Sub New (singletonInstance As T, keyPredicate As Func(Of Object, Boolean))

Parameters

singletonInstance
T

The instance to return.

keyPredicate
Func<Object,Boolean>

A predicate that takes the key object and returns true if and only if it matches.

Applies to

SingletonDependencyResolver<T>(T, Object)

Constructs a new resolver that will return the given instance for the contract type if the given key matches exactly the key passed to the Get method.

public SingletonDependencyResolver (T singletonInstance, object key);
new System.Data.Entity.Infrastructure.DependencyResolution.SingletonDependencyResolver<'T (requires 'T : null)> : 'T * obj -> System.Data.Entity.Infrastructure.DependencyResolution.SingletonDependencyResolver<'T (requires 'T : null)>
Public Sub New (singletonInstance As T, key As Object)

Parameters

singletonInstance
T

The instance to return.

key
Object

Optionally, the key of the dependency to be resolved. This may be null for dependencies that are not differentiated by key.

Applies to