Class SingleServiceProvider<T>
A service provider that provides a single service.
public class SingleServiceProvider<T> : SingleServiceProvider, IServiceProvider
Type Parameters
T
The service type.
- Inheritance
-
SingleServiceProvider<T>
- Implements
- Inherited Members
- Extension Methods
Remarks
Note that the service type must match exactly; added service types that are base types of the requested service type will not be matched.
Constructors
SingleServiceProvider(T)
Initializes a new instance of the SingleServiceProvider<T> class.
public SingleServiceProvider(T serviceInstance)
Parameters
serviceInstance
TThe service instance.
Remarks
Note that the service type must match exactly; added service types that are base types of the requested service type will not be matched.
Exceptions
- ArgumentNullException
serviceInstance
is null.