IServiceProvider

This service provides access to the dependency injection container for registering, resolving and releasing components. It acts as an abstraction over the underlying dependency injection framework and supports resolving services using both named and typed constructor parameter arguments.

Methods

Method void ReleaseComponent(object component)
Description Releases specified component from the dependency injection container.
Method object Resolve(Type type)
Description Resolves and returns a registered component of specified Type.
Method bool HasComponent(Type type)
Description Returns true if a component of specified Type is registered in the dependency injection container.
Method T Resolve<T>()
Description Resolves and returns a registered component of type T.
Method object Resolve(Type type, NamedParameterResolver arguments)
Description Resolves and returns a registered component of specified Type using the supplied NamedParameterResolver as constructor arguments.
Method object Resolve(Type type, TypedParameterResolver arguments)
Description Resolves and returns a registered component of specified Type using the supplied TypedParameterResolver as constructor arguments. Typed arguments are matched against the parameter types of the component's constructors and converted to named constructor arguments before the component is resolved.
Method T Resolve<T>(string name, NamedParameterResolver arguments)
Description Resolves and returns the registered component of type T with specified name using the supplied NamedParameterResolver as constructor arguments.
Method T Resolve<T>(NamedParameterResolver arguments)
Description Resolves and returns a registered component of type T using the supplied NamedParameterResolver as constructor arguments.
Method T Resolve<T>(TypedParameterResolver arguments)
Description Resolves and returns a registered component of type T using the supplied TypedParameterResolver as constructor arguments. Typed arguments are matched against the parameter types of the component's constructors and converted to named constructor arguments before the component is resolved.
Method IServiceProvider Register(params IRegistration[] registrations)
Description Registers all supplied component registrations with the dependency injection container and returns this IServiceProvider instance.