Skip to content

AppLocator.GetServices() method

Defined in

Type: AppLocator Namespace: Splat Assembly: Splat.Core.dll

Applies to

net11.0, net10.0, net47, net471, net472, net48, net481

Overloads

  1. public static IEnumerable<T> GetServices<T>()

  2. public static IEnumerable<T> GetServices<T>(string contract)

1. Overload

public static IEnumerable<T> GetServices<T>()

View source (opens in a new tab)

Summary: Gets all instances of the given service type. Must return an empty collection if the service is not available (must not return null or throw).

Type parameters

NameDescription
TThe object type.

Returns: IEnumerable (opens in a new tab) -- A sequence of instances of the requested service type. The sequence should be empty (not null) if no objects of the given type are available.

2. Overload

public static IEnumerable<T> GetServices<T>(string contract)

View source (opens in a new tab)

Summary: Gets all instances of the given service type. Must return an empty collection if the service is not available (must not return null or throw).

Type parameters

NameDescription
TThe object type.

Parameters

NameTypeDescription
contractstring (opens in a new tab)A value which will retrieve only objects registered with the same contract.

Returns: IEnumerable (opens in a new tab) -- A sequence of instances of the requested service type. The sequence should be empty (not null) if no objects of the given type are available.