Skip to content

IMutableDependencyResolver.HasRegistration(Type?) method

Defined in

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

Applies to

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

Overloads

  1. bool HasRegistration(Type? serviceType)

  2. bool HasRegistration(Type? serviceType, string? contract)

  3. bool HasRegistration<T>()

  4. bool HasRegistration<T>(string? contract)

1. Overload

bool HasRegistration(Type? serviceType)

Summary: Determines whether a registration exists for the specified service type.

Parameters

NameTypeDescription
serviceTypeType? (opens in a new tab)The type of the service to check for registration. Can be null to indicate an unspecified service type.

Returns: bool (opens in a new tab) -- true if a registration exists for the specified service type; otherwise, false.

2. Overload

bool HasRegistration(Type? serviceType, string? contract)

Summary: Determines whether a registration exists for the specified service type and contract.

Parameters

NameTypeDescription
serviceTypeType? (opens in a new tab)The type of the service to check for registration. Can be null to indicate a default or unspecified service type, depending on the implementation.
contractstring? (opens in a new tab)An optional contract name that distinguishes between multiple registrations of the same service type. Can be null or empty to indicate the default contract.

Returns: bool (opens in a new tab) -- true if a registration exists for the specified service type and contract; otherwise, false.

3. Overload

bool HasRegistration<T>()

Summary: Determines whether a registration exists for the specified service type.

Type parameters

NameDescription
TThe type of the service to check for registration.

Returns: bool (opens in a new tab) -- true if a registration for the specified service type exists; otherwise, false.

4. Overload

bool HasRegistration<T>(string? contract)

Summary: Determines whether a registration exists for the specified service type and contract.

Type parameters

NameDescription
TThe service type to check for a registration.

Parameters

NameTypeDescription
contractstring? (opens in a new tab)An optional contract name that identifies a specific registration. Can be null to check for the default registration.

Returns: bool (opens in a new tab) -- true if a registration exists for the specified service type and contract; otherwise, false.