Skip to content

InstanceGenericFirstDependencyResolver.HasRegistration() method

Defined in

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

Applies to

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

Overloads

  1. public bool HasRegistration<T>()

  2. public bool HasRegistration<T>(string? contract)

  3. public bool HasRegistration(Type? serviceType)

  4. public bool HasRegistration(Type? serviceType, string? contract)

1. Overload

public bool HasRegistration<T>()

View source (opens in a new tab)

Inherited documentation

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

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.

2. Overload

public bool HasRegistration<T>(string? contract)

View source (opens in a new tab)

Inherited documentation

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

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.

3. Overload

public bool HasRegistration(Type? serviceType)

View source (opens in a new tab)

Inherited documentation

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

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.

4. Overload

public bool HasRegistration(Type? serviceType, string? contract)

View source (opens in a new tab)

Inherited documentation

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

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.