Skip to content

ServiceLocator.TryGetService(T) method

Defined in

Type: ServiceLocator 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. public bool TryGetService<T>(out T service)
  • 2. public bool TryGetService<T>(string contract, out T service)

1. Overload

public bool TryGetService<T>(out T service)

View source

Inherited documentation

These docs were inherited from IGetServices. The member doesn't override them on this type.

Summary: Try and get the service.

Type parameters

NameDescription
TThe service type.

Parameters

NameTypeDescription
out serviceTThe service.

Returns: bool -- A value indicating whether the service exists.

2. Overload

public bool TryGetService<T>(string contract, out T service)

View source

Inherited documentation

These docs were inherited from IGetServices. The member doesn't override them on this type.

Summary: Try and get the service.

Type parameters

NameDescription
TThe service type.

Parameters

NameTypeDescription
contractstringThe contract.
out serviceTThe service.

Returns: bool -- A value indicating whether the service exists.