Skip to content

ModernDependencyResolver.UnregisterAll(Type?) method

Defined in

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

Applies to

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

Overloads

  1. public void UnregisterAll(Type? serviceType)

  2. public void UnregisterAll(Type? serviceType, string? contract)

  3. public void UnregisterAll<T>()

  4. public void UnregisterAll<T>(string? contract)

1. Overload

public void UnregisterAll(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: Unregisters all service registrations for the specified service type.

Parameters

NameTypeDescription
serviceTypeType? (opens in a new tab)The type of service for which to remove all registrations. If null, all service registrations are removed.

2. Overload

public void UnregisterAll(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: Unregisters all service registrations that match the specified service type and contract.

Parameters

NameTypeDescription
serviceTypeType? (opens in a new tab)The type of the service to unregister. If null, all service types are considered.
contractstring? (opens in a new tab)The contract name to match when unregistering services. If null, all contracts are considered.

3. Overload

public void UnregisterAll<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: Unregisters all instances of the specified type from the registry or container.

Type parameters

NameDescription
TThe type of objects to unregister.

Remarks

After calling this method, no instances of type T will remain registered. Subsequent requests for T may fail or result in new registrations, depending on the container's behavior.

4. Overload

public void UnregisterAll<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: Unregisters all instances of the specified type that are associated with the given contract.

Type parameters

NameDescription
TThe type of the instances to unregister.

Parameters

NameTypeDescription
contractstring? (opens in a new tab)The contract name used to identify the registrations to remove. Can be null to target registrations without a contract.