Skip to content

NinjectDependencyResolver.UnregisterCurrent(Type?) method

Defined in

Type: NinjectDependencyResolver Namespace: Splat.Ninject Assembly: Splat.Ninject.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 UnregisterCurrent(Type? serviceType)
  • 2. public virtual void UnregisterCurrent(Type? serviceType, string? contract)
  • 3. public void UnregisterCurrent<T>()
  • 4. public void UnregisterCurrent<T>(string? contract)

1. Overload

public virtual void UnregisterCurrent(Type? serviceType)

View source

Inherited documentation

These docs were inherited from IMutableDependencyResolver. The member doesn't override them on this type.

Summary: Unregisters the current instance of the specified service type from the context.

Parameters

NameTypeDescription
serviceTypeType?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

public virtual void UnregisterCurrent(Type? serviceType, string? contract)

View source

Inherited documentation

These docs were inherited from IMutableDependencyResolver. The member doesn't override them on this type.

Summary: Unregisters the current instance of the specified service type and contract from the container.

Parameters

NameTypeDescription
serviceTypeType?The type of the service to unregister. If null, the default service type is used.
contractstring?An optional contract name that identifies the registration to remove. If null, the default contract is used.

3. Overload

public void UnregisterCurrent<T>()

View source

Inherited documentation

These docs were inherited from IMutableDependencyResolver. The member doesn't override them on this type.

Summary: Unregisters the current instance of the specified type from the context.

Type parameters

NameDescription
TThe type of the instance to unregister from the current context.

4. Overload

public void UnregisterCurrent<T>(string? contract)

View source

Inherited documentation

These docs were inherited from IMutableDependencyResolver. The member doesn't override them on this type.

Summary: Unregisters the current instance of type T associated with the specified contract, if any.

Type parameters

NameDescription
TThe type of the instance to unregister.

Parameters

NameTypeDescription
contractstring?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.