GlobalGenericFirstDependencyResolver.UnregisterAll() method¶
Defined in
Type: GlobalGenericFirstDependencyResolver
Namespace: Splat
Assembly: Splat.Core.dll
Applies to
net10.0, net9.0, net8.0, net462, net481
Overloads¶
-
public void UnregisterAll<T>() -
public void UnregisterAll<T>(string? contract) -
public void UnregisterAll(Type? serviceType) -
public void UnregisterAll(Type? serviceType, string? contract)
1. Overload¶
public void UnregisterAll<T>()
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
| Name | Description |
|---|---|
T | The 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.
2. Overload¶
public void UnregisterAll<T>(string? contract)
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
| Name | Description |
|---|---|
T | The type of the instances to unregister. |
Parameters
| Name | Type | Description |
|---|---|---|
contract | string? | The contract name used to identify the registrations to remove. Can be null to target registrations without a contract. |
3. Overload¶
public void UnregisterAll(Type? serviceType)
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
| Name | Type | Description |
|---|---|---|
serviceType | Type? | The type of service for which to remove all registrations. If null, all service registrations are removed. |
4. Overload¶
public void UnregisterAll(Type? serviceType, string? contract)
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
| Name | Type | Description |
|---|---|---|
serviceType | Type? | The type of the service to unregister. If null, all service types are considered. |
contract | string? | The contract name to match when unregistering services. If null, all contracts are considered. |