Skip to content

SimpleInjectorDependencyResolver.HasRegistration(Type?) method

Defined in

Type: SimpleInjectorDependencyResolver Namespace: Splat.SimpleInjector Assembly: Splat.SimpleInjector.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, net471

Overloads

  • 1. public bool HasRegistration(Type? serviceType)
  • 2. public bool HasRegistration(Type? serviceType, string? contract)
  • 3. public bool HasRegistration<T>()
  • 4. public bool HasRegistration<T>(string? contract)

1. Overload

public bool HasRegistration(Type? serviceType)

View source

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?The type of the service to check for registration. Can be null to indicate an unspecified service type.

Returns: bool -- true if a registration exists for the specified service type; otherwise, false.

2. Overload

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

View source

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?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?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 -- true if a registration exists for the specified service type and contract; otherwise, false.

3. Overload

public bool HasRegistration<T>()

View source

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 -- true if a registration for the specified service type exists; otherwise, false.

4. Overload

public bool HasRegistration<T>(string? contract)

View source

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?An optional contract name that identifies a specific registration. Can be null to check for the default registration.

Returns: bool -- true if a registration exists for the specified service type and contract; otherwise, false.