AutofacDependencyResolver.UnregisterAll(Type?) method¶
Defined in
Type: AutofacDependencyResolver
Namespace: Splat.Autofac
Assembly: Splat.Autofac.dll
Applies to
net10.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net9.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0, net8.0-ios17.5, net8.0-macos14.5, net8.0-macos14.5, net8.0-macos14.2, net8.0-macos14.2, net8.0-maccatalyst17.5, net8.0-maccatalyst17.5, net8.0-ios17.5, net8.0-tvos17.2, net8.0-tvos17.2, netstandard2.1, netstandard2.1, netstandard2.0, netstandard2.0, net471, net481, net462
Overloads¶
- 1.
public virtual void UnregisterAll(Type? serviceType) - 2.
public virtual void UnregisterAll(Type? serviceType, string? contract) - 3.
public void UnregisterAll<T>() - 4.
public void UnregisterAll<T>(string? contract)
1. Overload¶
Deprecated
Because Autofac 5+ containers are immutable, UnregisterAll method is not available anymore. Instead, simply register your service after InitializeReactiveUI to override it https://autofaccn.readthedocs.io/en/latest/register/registration.html#default-registrations.
Attributes: [Obsolete("Because Autofac 5+ containers are immutable, UnregisterAll method is not available anymore. Instead, simply register your service after InitializeReactiveUI to override it https://autofaccn.readthedocs.io/en/latest/register/registration.html#default-registrations.")]
public virtual void UnregisterAll(Type? serviceType)
Inherited documentation
These docs were inherited from IMutableDependencyResolver. The member doesn't override them on this type.
Summary: Because Autofac 5+ containers are immutable, UnregisterAll method is not available anymore. Instead, simply register your service after InitializeReactiveUI to override it.
Parameters
| Name | Type | Description |
|---|---|---|
serviceType | Type? | The service type to unregister. |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | This is not implemented by default. |
2. Overload¶
Deprecated
Because Autofac 5+ containers are immutable, UnregisterAll method is not available anymore. Instead, simply register your service after InitializeReactiveUI to override it https://autofaccn.readthedocs.io/en/latest/register/registration.html#default-registrations.
Attributes: [Obsolete("Because Autofac 5+ containers are immutable, UnregisterAll method is not available anymore. Instead, simply register your service after InitializeReactiveUI to override it https://autofaccn.readthedocs.io/en/latest/register/registration.html#default-registrations.")]
public virtual void UnregisterAll(Type? serviceType, string? contract)
Inherited documentation
These docs were inherited from IMutableDependencyResolver. The member doesn't override them on this type.
Summary: Because Autofac 5+ containers are immutable, UnregisterAll method is not available anymore. Instead, simply register your service after InitializeReactiveUI to override it.
Parameters
| Name | Type | Description |
|---|---|---|
serviceType | Type? | The service type to unregister. |
contract | string? | The optional contract value, which will only remove the value associated with the contract. |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | This is not implemented by default. |
3. Overload¶
Deprecated
Because Autofac 5+ containers are immutable, UnregisterAll method is not available anymore. Instead, simply register your service after InitializeReactiveUI to override it https://autofaccn.readthedocs.io/en/latest/register/registration.html#default-registrations.
Attributes: [Obsolete("Because Autofac 5+ containers are immutable, UnregisterAll method is not available anymore. Instead, simply register your service after InitializeReactiveUI to override it https://autofaccn.readthedocs.io/en/latest/register/registration.html#default-registrations.")]
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.
4. Overload¶
Deprecated
Because Autofac 5+ containers are immutable, UnregisterAll method is not available anymore. Instead, simply register your service after InitializeReactiveUI to override it https://autofaccn.readthedocs.io/en/latest/register/registration.html#default-registrations.
Attributes: [Obsolete("Because Autofac 5+ containers are immutable, UnregisterAll method is not available anymore. Instead, simply register your service after InitializeReactiveUI to override it https://autofaccn.readthedocs.io/en/latest/register/registration.html#default-registrations.")]
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. |