Class ServiceProvider
The default IServiceProvider.
Inherited Members
Namespace: nanoFramework.DependencyInjection
Assembly: nanoFramework.DependencyInjection.dll
Syntax
public sealed class ServiceProvider : IServiceProvider, IDisposable
Methods
CreateScope()
Declaration
public IServiceScope CreateScope()
Returns
Type | Description |
---|---|
IServiceScope |
Exceptions
Type | Condition |
---|---|
AggregateException | Some services are not able to be constructed. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Exceptions
Type | Condition |
---|---|
AggregateException | Some services are not able to be constructed. |
GetService(Type)
Gets the service object of the specified type.
Declaration
public object GetService(Type serviceType)
Parameters
Type | Name | Description |
---|---|---|
Type | serviceType | An object that specifies the type of service object to get. |
Returns
Type | Description |
---|---|
object | A service object of type |
Exceptions
Type | Condition |
---|---|
AggregateException | Some services are not able to be constructed. |
GetService(Type[])
Gets the service objects of the specified type.
Declaration
public object[] GetService(Type[] serviceType)
Parameters
Type | Name | Description |
---|---|---|
Type[] | serviceType | An array object that specifies the type of service object to get. |
Returns
Type | Description |
---|---|
object[] | A service object array of type |
Exceptions
Type | Condition |
---|---|
AggregateException | Some services are not able to be constructed. |