Class ServiceProvider
- Namespace
- Microsoft.Extensions.DependencyInjection
- Assembly
- nanoFramework.DependencyInjection.dll
The default IServiceProvider.
public sealed class ServiceProvider : IServiceProvider, IServiceProviderIsService, IDisposable- Inheritance
- 
      
      ServiceProvider
- Implements
- Inherited Members
- Extension Methods
Methods
CreateScope()
public IServiceScope CreateScope()Returns
Exceptions
- AggregateException
- Some services are not able to be constructed. 
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()Exceptions
- AggregateException
- Some services are not able to be constructed. 
GetService(Type)
Gets the service object of the specified type.
public object GetService(Type serviceType)Parameters
- serviceTypeType
- An object that specifies the type of service object to get. 
Returns
- object
- A service object of type - serviceType. -or- null if there is no service object of type- serviceType.
Exceptions
- AggregateException
- Some services are not able to be constructed. 
GetService(Type[])
Gets the service objects of the specified type.
public object[] GetService(Type[] serviceType)Parameters
- serviceTypeType[]
- An array object that specifies the type of service object to get. 
Returns
- object[]
- A service object array of type - serviceType. -or- array empty if there is no service object of type- serviceType.
Exceptions
- AggregateException
- Some services are not able to be constructed. 
IsService(Type)
Determines if the specified service type is available from the IServiceProvider.
public bool IsService(Type serviceType)Parameters
- serviceTypeType
- An object that specifies the type of service object to test. 
Returns
- bool
- true if the specified service is a available, false if it is not. 
Exceptions
- AggregateException
- Some services are not able to be constructed.