IServiceLocator.GetServices() method¶
Defined in
Type: IServiceLocator
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, net471
Overloads¶
- 1.
IEnumerable<T> GetServices<T>() - 2.
IEnumerable<T> GetServices<T>(string contract)
1. Overload¶
IEnumerable<T> GetServices<T>()
Summary: Gets all registered service instances of the specified type.
Type parameters
| Name | Description |
|---|---|
T | The type of service to retrieve. |
Returns: IEnumerable
2. Overload¶
IEnumerable<T> GetServices<T>(string contract)
Summary: Gets all registered service instances of the specified type that match the given contract name.
Type parameters
| Name | Description |
|---|---|
T | The type of service to retrieve. |
Parameters
| Name | Type | Description |
|---|---|---|
contract | string | The contract name used to filter the services. Only services registered with this contract will be returned. Cannot be null. |
Returns: IEnumerable