IMutableDependencyResolver.UnregisterCurrent(Type?) method¶
Defined in
Type: IMutableDependencyResolver
Namespace: Splat
Assembly: Splat.Core.dll
Applies to
net10.0, net9.0, net8.0, net462, net481
Overloads¶
-
void UnregisterCurrent(Type? serviceType) -
void UnregisterCurrent(Type? serviceType, string? contract) -
void UnregisterCurrent<T>() -
void UnregisterCurrent<T>(string? contract)
1. Overload¶
void UnregisterCurrent(Type? serviceType)
Summary: Unregisters the current instance of the specified service type from the context.
Parameters
| Name | Type | Description |
|---|---|---|
serviceType | Type? | The type of the service to unregister. If null, the default service type is used. |
Remarks
If no instance of the specified service type is registered, this method has no effect.
2. Overload¶
void UnregisterCurrent(Type? serviceType, string? contract)
Summary: Unregisters the current instance of the specified service type and contract from the container.
Parameters
| Name | Type | Description |
|---|---|---|
serviceType | Type? | The type of the service to unregister. If null, the default service type is used. |
contract | string? | An optional contract name that identifies the registration to remove. If null, the default contract is used. |
3. Overload¶
void UnregisterCurrent<T>()
Summary: Unregisters the current instance of the specified type from the context.
Type parameters
| Name | Description |
|---|---|
T | The type of the instance to unregister from the current context. |
4. Overload¶
void UnregisterCurrent<T>(string? contract)
Summary: Unregisters the current instance of type T associated with the specified contract, if any.
Type parameters
| Name | Description |
|---|---|
T | The type of the instance to unregister. |
Parameters
| Name | Type | Description |
|---|---|---|
contract | string? | An optional contract name that specifies which registration to remove. If null, the default registration for type T is unregistered. |
Remarks
If no instance of type T is registered with the specified contract, this method has no effect.