SingletonDependencyResolver<T> Class

 

Implements IDbDependencyResolver to resolve a dependency such that it always returns the same instance.

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

System.Object
  System.Data.Entity.Infrastructure.DependencyResolution.SingletonDependencyResolver<T>

public class SingletonDependencyResolver<T> : IDbDependencyResolver
where T : class

Type Parameters

T

The type that defines the contract for the dependency that will be resolved.

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.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetService(Type, Object)

Attempts to resolve a dependency for a given contract type and optionally a given key. If the resolver cannot resolve the dependency then it must return null and not throw. This allows resolvers to be used in a Chain of Responsibility pattern such that multiple resolvers can be asked to resolve a dependency until one finally does.

System_CAPS_pubmethodGetServices(Type, Object)

Attempts to resolve a dependencies for a given contract type and optionally a given key. If the resolver cannot resolve the dependency then it must return an empty enumeration and not throw.

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubmethodGetService(Type)

Overloaded. Calls GetService passing the given type argument and using null for the name argument.(Defined by DbDependencyResolverExtensions.)

System_CAPS_pubmethodGetService<T>()

Overloaded. Calls GetService passing the generic type of the method as the type argument and null for the name argument.(Defined by DbDependencyResolverExtensions.)

System_CAPS_pubmethodGetService<T>(Object)

Overloaded. Calls GetService passing the generic type of the method and the given name as arguments.(Defined by DbDependencyResolverExtensions.)

System_CAPS_pubmethodGetServices(Type)

Overloaded. Calls GetServices passing the given type argument and using null for the name argument.(Defined by DbDependencyResolverExtensions.)

System_CAPS_pubmethodGetServices<T>()

Overloaded. Calls GetServices passing the generic type of the method as the type argument and null for the name argument.(Defined by DbDependencyResolverExtensions.)

System_CAPS_pubmethodGetServices<T>(Object)

Overloaded. Calls GetServices passing the generic type of the method and the given name as arguments.(Defined by DbDependencyResolverExtensions.)

This class is immutable such that instances can be accessed by multiple threads at the same time.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.