SingletonDependencyResolver<T> Constructor

 

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

Namespace:   System.Data.Entity.Infrastructure.DependencyResolution
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodSingletonDependencyResolver<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.

System_CAPS_pubmethodSingletonDependencyResolver<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.

System_CAPS_pubmethodSingletonDependencyResolver<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> Constructor (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
)

Parameters

singletonInstance
Type: T

The instance to return.


SingletonDependencyResolver<T> Constructor (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
)

Parameters

singletonInstance
Type: T

The instance to return.

keyPredicate
Type: System.Func<Object, Boolean>

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


SingletonDependencyResolver<T> Constructor (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
)

Parameters

singletonInstance
Type: T

The instance to return.

key
Type: System.Object

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