IServiceLocator.GetLazyService() method¶
Defined in
Type: IServiceLocator
Namespace: Splat
Assembly: Splat.Core.dll
Applies to
net10.0, net9.0, net8.0, net462, net481
Overloads¶
-
Lazy<T> GetLazyService<T>() -
Lazy<T> GetLazyService<T>(string contract)
1. Overload¶
Lazy<T> GetLazyService<T>()
Summary: Retrieves a lazily initialized instance of the specified service type from the dependency injection container.
Type parameters
| Name | Description |
|---|---|
T | The type of the service to retrieve. Must have a public parameterless constructor. |
Returns: Lazy
2. Overload¶
Lazy<T> GetLazyService<T>(string contract)
Summary: Retrieves a lazily initialized service of the specified type associated with the given contract name.
Type parameters
| Name | Description |
|---|---|
T | The type of the service to retrieve. Must have a public parameterless constructor. |
Parameters
| Name | Type | Description |
|---|---|---|
contract | string | The contract name that identifies the service to retrieve. Cannot be null. |
Returns: Lazy