#### [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')

## TenantPartitionedRateLimiter\<TResource\> Class

Spends a budget the server keeps per caller \- failed client authentications, introspection and revocation
requests \- separately for each tenant\.

```csharp
public sealed class TenantPartitionedRateLimiter<TResource> : System.Threading.RateLimiting.PartitionedRateLimiter<TResource>
```
#### Type parameters

###### `TResource` {#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.TResource}

What the budget is partitioned by\.

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → [System\.Threading\.RateLimiting\.PartitionedRateLimiter&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.ratelimiting.partitionedratelimiter-1 'System\.Threading\.RateLimiting\.PartitionedRateLimiter\`1')[TResource](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.TResource 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantPartitionedRateLimiter\<TResource\>\.TResource')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.ratelimiting.partitionedratelimiter-1 'System\.Threading\.RateLimiting\.PartitionedRateLimiter\`1') → TenantPartitionedRateLimiter\<TResource\>

### Remarks
The budget is partitioned by what it is spent on, a client id or a source address, which two tenants can share:
without this, attempts against one tenant's client would spend another tenant's client of the same id\. Each
tenant gets a limiter of its own, built the way the budget was registered, so the resource reaches it as the
server produced it \- a host's own limiter partitions by the address or client it was written for\.
### Constructors

## TenantPartitionedRateLimiter\(Func\<PartitionedRateLimiter\<TResource\>\>, ITenantAccessor, ITenantCatalog\) Constructor {#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.TenantPartitionedRateLimiter(System.Func_System.Threading.RateLimiting.PartitionedRateLimiter_TResource__,Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor,Abblix.Oidc.Server.Features.MultiTenancy.ITenantCatalog)}

Spends a budget the server keeps per caller \- failed client authentications, introspection and revocation
requests \- separately for each tenant\.

```csharp
public TenantPartitionedRateLimiter(System.Func<System.Threading.RateLimiting.PartitionedRateLimiter<TResource>> createLimiter, Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor tenantAccessor, Abblix.Oidc.Server.Features.MultiTenancy.ITenantCatalog catalog);
```
#### Parameters

###### `createLimiter` [System\.Func&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.func-1 'System\.Func\`1')[System\.Threading\.RateLimiting\.PartitionedRateLimiter&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.ratelimiting.partitionedratelimiter-1 'System\.Threading\.RateLimiting\.PartitionedRateLimiter\`1')[TResource](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.TResource 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantPartitionedRateLimiter\<TResource\>\.TResource')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.ratelimiting.partitionedratelimiter-1 'System\.Threading\.RateLimiting\.PartitionedRateLimiter\`1')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.func-1 'System\.Func\`1') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.TenantPartitionedRateLimiter(System.Func_System.Threading.RateLimiting.PartitionedRateLimiter_TResource__,Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor,Abblix.Oidc.Server.Features.MultiTenancy.ITenantCatalog).createLimiter}

Builds a new limiter for a tenant that has none yet\.

###### `tenantAccessor` [ITenantAccessor](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.ITenantAccessor') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.TenantPartitionedRateLimiter(System.Func_System.Threading.RateLimiting.PartitionedRateLimiter_TResource__,Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor,Abblix.Oidc.Server.Features.MultiTenancy.ITenantCatalog).tenantAccessor}

Names the tenant a budget is spent for\.

###### `catalog` [ITenantCatalog](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.ITenantCatalog 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.ITenantCatalog') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.TenantPartitionedRateLimiter(System.Func_System.Threading.RateLimiting.PartitionedRateLimiter_TResource__,Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor,Abblix.Oidc.Server.Features.MultiTenancy.ITenantCatalog).catalog}

Tells when a tenant is released, and its limiter with it\.

### Remarks
The budget is partitioned by what it is spent on, a client id or a source address, which two tenants can share:
without this, attempts against one tenant's client would spend another tenant's client of the same id\. Each
tenant gets a limiter of its own, built the way the budget was registered, so the resource reaches it as the
server produced it \- a host's own limiter partitions by the address or client it was written for\.
### Methods

## TenantPartitionedRateLimiter\<TResource\>\.GetStatistics\(TResource\) Method {#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.GetStatistics(TResource)}

Gets a snapshot of the statistics for the [resource](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.GetStatistics(TResource).resource 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantPartitionedRateLimiter\<TResource\>\.GetStatistics\(TResource\)\.resource') if available\.

```csharp
public override System.Threading.RateLimiting.RateLimiterStatistics? GetStatistics(TResource resource);
```
#### Parameters

###### `resource` [TResource](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.TResource 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantPartitionedRateLimiter\<TResource\>\.TResource') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.GetStatistics(TResource).resource}

#### Returns
[System\.Threading\.RateLimiting\.RateLimiterStatistics](https://learn.microsoft.com/en-us/dotnet/api/system.threading.ratelimiting.ratelimiterstatistics 'System\.Threading\.RateLimiting\.RateLimiterStatistics')  
An instance of [System\.Threading\.RateLimiting\.RateLimiterStatistics](https://learn.microsoft.com/en-us/dotnet/api/system.threading.ratelimiting.ratelimiterstatistics 'System\.Threading\.RateLimiting\.RateLimiterStatistics') containing a snapshot of the statistics for a [resource](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_#Abblix.Oidc.Server.Features.MultiTenancy.TenantPartitionedRateLimiter_TResource_.GetStatistics(TResource).resource 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantPartitionedRateLimiter\<TResource\>\.GetStatistics\(TResource\)\.resource')\.
