IServiceLocator.HasService() method¶
Defined in
Type: IServiceLocator
Namespace: Splat
Assembly: Splat.Core.dll
Applies to
net10.0, net9.0, net8.0, net462, net481
Overloads¶
-
bool HasService<T>() -
bool HasService<T>(string contract)
1. Overload¶
bool HasService<T>()
Summary: Determines whether a service of the specified type is available from the service provider.
Type parameters
| Name | Description |
|---|---|
T | The type of service to check for availability. |
Returns: bool -- true if a service of type T is available; otherwise, false.
2. Overload¶
bool HasService<T>(string contract)
Summary: Determines whether a service of the specified type and contract is available from the service provider.
Type parameters
| Name | Description |
|---|---|
T | The type of the service to check for. |
Parameters
| Name | Type | Description |
|---|---|---|
contract | string | The contract name that identifies the service. Cannot be null. |
Returns: bool -- true if a service of type T with the specified contract is available; otherwise, false.