GetService Method
GetService(Type)
Gets the service object of the specified type. Returns null when the service is not available.
Declaration
public object GetService(Type serviceType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | serviceType |
Returns
Type | Description |
---|---|
System.Object |
Implements
System.IServiceProvider.GetService(System.Type)
GetService<T>()
Gets the service object of the type T. Returns null when the service is not available.
Declaration
public T GetService<T>()
where T : class
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |