)} ,System.Threading.LazyThreadSafetyMode)} )} ,System.String)} ,System.String)} ,System.String,System.Threading.LazyThreadSafetyMode)}
IEditServices.AddLazySingleton(Lazy) method¶
Defined in
Type: IEditServices
Namespace: ReactiveMarbles.Locator
Assembly: ReactiveMarbles.Locator.dll
Applies to
net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.0
Overloads¶
- 1.
void AddLazySingleton<TContract>(Lazy<TContract> lazy) - 2.
void AddLazySingleton<TContract>(Func<TContract> instanceFactory, LazyThreadSafetyMode threadSafetyMode) - 3.
void AddLazySingleton<TContract>(Func<TContract> instanceFactory) - 4.
void AddLazySingleton<TContract>(Lazy<TContract> lazy, string contract) - 5.
void AddLazySingleton<TContract>(Func<TContract> instanceFactory, string contract) - 6.
void AddLazySingleton<TContract>(Func<TContract> instanceFactory, string contract, LazyThreadSafetyMode threadSafetyMode)
1. Overload¶
void AddLazySingleton<TContract>(Lazy<TContract> lazy)
Summary: Adds a lazy single instance service.
Type parameters
| Name | Description |
|---|---|
TContract | The contract type. |
Parameters
| Name | Type | Description |
|---|---|---|
lazy | Lazy | The lazy instance. |
2. Overload¶
void AddLazySingleton<TContract>(Func<TContract> instanceFactory, LazyThreadSafetyMode threadSafetyMode)
Summary: Adds a lazy single instance service.
Type parameters
| Name | Description |
|---|---|
TContract | The contract type. |
Parameters
| Name | Type | Description |
|---|---|---|
instanceFactory | Func | The instance factory. |
threadSafetyMode | LazyThreadSafetyMode | The thread safety mode. |
3. Overload¶
void AddLazySingleton<TContract>(Func<TContract> instanceFactory)
Summary: Adds a lazy single instance service.
Type parameters
| Name | Description |
|---|---|
TContract | The contract type. |
Parameters
| Name | Type | Description |
|---|---|---|
instanceFactory | Func | The instance factory. |
4. Overload¶
void AddLazySingleton<TContract>(Lazy<TContract> lazy, string contract)
Summary: Adds a lazy single instance service.
Type parameters
| Name | Description |
|---|---|
TContract | The contract type. |
Parameters
| Name | Type | Description |
|---|---|---|
lazy | Lazy | The lazy instance. |
contract | string | The contract. |
5. Overload¶
void AddLazySingleton<TContract>(Func<TContract> instanceFactory, string contract)
Summary: Adds a lazy single instance service.
Type parameters
| Name | Description |
|---|---|
TContract | The contract type. |
Parameters
| Name | Type | Description |
|---|---|---|
instanceFactory | Func | The instance factory. |
contract | string | The contract. |
6. Overload¶
void AddLazySingleton<TContract>(Func<TContract> instanceFactory, string contract, LazyThreadSafetyMode threadSafetyMode)
Summary: Adds a lazy single instance service.
Type parameters
| Name | Description |
|---|---|
TContract | The contract type. |
Parameters
| Name | Type | Description |
|---|---|---|
instanceFactory | Func | The instance factory. |
contract | string | The contract. |
threadSafetyMode | LazyThreadSafetyMode | The thread safety mode. |