AppLocator.GetServices() method¶
Defined in
Type: AppLocator
Namespace: Splat
Assembly: Splat.Core.dll
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
Overloads¶
- 1.
public static IEnumerable<T> GetServices<T>() - 2.
public static IEnumerable<T> GetServices<T>(string contract)
1. Overload¶
public static IEnumerable<T> GetServices<T>()
Summary:
Gets all instances of the given service type. Must return an empty
collection if the service is not available (must not return null or throw).
Type parameters
| Name | Description |
|---|---|
T | The object type. |
Returns: IEnumerablenull) if no objects of the given type are available.
2. Overload¶
public static IEnumerable<T> GetServices<T>(string contract)
Summary:
Gets all instances of the given service type. Must return an empty
collection if the service is not available (must not return null or throw).
Type parameters
| Name | Description |
|---|---|
T | The object type. |
Parameters
| Name | Type | Description |
|---|---|---|
contract | string | A value which will retrieve only objects registered with the same contract. |
Returns: IEnumerablenull) if no objects of the given type are available.