#### [Abblix\.Oidc\.Server](https://www.abblix.com/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Features\.MultiTenancy](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy 'Abblix\.Oidc\.Server\.Features\.MultiTenancy')

## ITenantClosing Interface

Lets go of what a tenant kept outside the server's memory once the tenant is released, as the streams a
transmitter stored for it\.

```csharp
public interface ITenantClosing
```

Derived  
↳ [TenantKeyRingClosing](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantKeyRingClosing 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantKeyRingClosing')

### Remarks
The catalog of this instance hands over the tenants one reading releases, all at once, so a closing reads a store
the tenants share once for all of them\. Each tenant is released at the first reading at least one refresh period
after a reading first found it gone from the store, in the definition last served for that creation, or the one it
was first listed in when it was never served\. Each closing is called once per reading, with a token canceled one
refresh period after the call begins, and the reading waits for the call to end, so a closing heeds that token:
one that does not holds the reading, and every reading after it, for as long as it runs\. One reading may release
two creations of one id, so a closing reports each tenant by the definition it was handed\. A tenant a closing
reports, and every tenant of a call that throws, runs out of time or is stopped, is logged with its id and
generation and is not handed over again; the other closings still run\. A tenant gone from the store while no
instance served it, as during a restart, is never listed by the new instance and so is never released or closed\.
A tenant created again under the same id is a different creation, so closing the one released leaves what the new
one keeps alone\.
### Methods

## ITenantClosing\.CloseAsync\(IReadOnlyCollection\<TenantDefinition\>, CancellationToken\) Method {#Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken)}

Lets go of what each of [tenants](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing#Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken).tenants 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.ITenantClosing\.CloseAsync\(System\.Collections\.Generic\.IReadOnlyCollection\<Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition\>, System\.Threading\.CancellationToken\)\.tenants') kept, each one on its own, so one that fails leaves the
others closed\.

```csharp
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,System.Exception>> CloseAsync(System.Collections.Generic.IReadOnlyCollection<Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition> tenants, System.Threading.CancellationToken cancellationToken);
```
#### Parameters

###### `tenants` [System\.Collections\.Generic\.IReadOnlyCollection&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlycollection-1 'System\.Collections\.Generic\.IReadOnlyCollection\`1')[TenantDefinition](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlycollection-1 'System\.Collections\.Generic\.IReadOnlyCollection\`1') {#Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken).tenants}

The tenants released, each in the creation that was served\.

###### `cancellationToken` [System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken') {#Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken).cancellationToken}

Cancels the closing\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[System\.Collections\.Generic\.IReadOnlyDictionary&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2 'System\.Collections\.Generic\.IReadOnlyDictionary\`2')[TenantDefinition](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition')[,](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2 'System\.Collections\.Generic\.IReadOnlyDictionary\`2')[System\.Exception](https://learn.microsoft.com/en-us/dotnet/api/system.exception 'System\.Exception')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2 'System\.Collections\.Generic\.IReadOnlyDictionary\`2')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
Why each tenant that could not be closed, wholly or in part, was not, by the definition it was handed
            in; the others are closed\.
