Skip to content

)} ,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

NameDescription
TContractThe contract type.

Parameters

NameTypeDescription
lazyLazyThe lazy instance.

2. Overload

void AddLazySingleton<TContract>(Func<TContract> instanceFactory, LazyThreadSafetyMode threadSafetyMode)

Summary: Adds a lazy single instance service.

Type parameters

NameDescription
TContractThe contract type.

Parameters

NameTypeDescription
instanceFactoryFuncThe instance factory.
threadSafetyModeLazyThreadSafetyModeThe thread safety mode.

3. Overload

void AddLazySingleton<TContract>(Func<TContract> instanceFactory)

Summary: Adds a lazy single instance service.

Type parameters

NameDescription
TContractThe contract type.

Parameters

NameTypeDescription
instanceFactoryFuncThe instance factory.

4. Overload

void AddLazySingleton<TContract>(Lazy<TContract> lazy, string contract)

Summary: Adds a lazy single instance service.

Type parameters

NameDescription
TContractThe contract type.

Parameters

NameTypeDescription
lazyLazyThe lazy instance.
contractstringThe contract.

5. Overload

void AddLazySingleton<TContract>(Func<TContract> instanceFactory, string contract)

Summary: Adds a lazy single instance service.

Type parameters

NameDescription
TContractThe contract type.

Parameters

NameTypeDescription
instanceFactoryFuncThe instance factory.
contractstringThe contract.

6. Overload

void AddLazySingleton<TContract>(Func<TContract> instanceFactory, string contract, LazyThreadSafetyMode threadSafetyMode)

Summary: Adds a lazy single instance service.

Type parameters

NameDescription
TContractThe contract type.

Parameters

NameTypeDescription
instanceFactoryFuncThe instance factory.
contractstringThe contract.
threadSafetyModeLazyThreadSafetyModeThe thread safety mode.