Skip to content

GlobalGenericFirstDependencyResolver.GetServices() method

Defined in

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

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Overloads

  • 1. public IEnumerable<T> GetServices<T>()
  • 2. public IEnumerable<T> GetServices<T>(string? contract)
  • 3. public IEnumerable<object> GetServices(Type? serviceType)
  • 4. public IEnumerable<object> GetServices(Type? serviceType, string? contract)

1. Overload

public IEnumerable<T> GetServices<T>()

View source

Inherited documentation

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

Summary: Gets all instances of the given T. 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 -- A sequence of instances of the requested T. The sequence should be empty (not null) if no objects of the given type are available.

2. Overload

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

View source

Inherited documentation

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

Summary: Gets all instances of the given T. 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?A value which will retrieve only objects registered with the same contract.

Returns: IEnumerable -- A sequence of instances of the requested T. The sequence should be empty (not null) if no objects of the given type are available.

3. Overload

public IEnumerable<object> GetServices(Type? serviceType)

View source

Inherited documentation

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

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

Parameters

NameTypeDescription
serviceTypeType?The object type.

Returns: IEnumerable -- A sequence of instances of the requested serviceType. The sequence should be empty (not null) if no objects of the given type are available.

4. Overload

public IEnumerable<object> GetServices(Type? serviceType, string? contract)

View source

Inherited documentation

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

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

Parameters

NameTypeDescription
serviceTypeType?The object type.
contractstring?A value which will retrieve only objects registered with the same contract.

Returns: IEnumerable -- A sequence of instances of the requested serviceType. The sequence should be empty (not null) if no objects of the given type are available.