Interface ITenantStore<TTenant>
This interface defines the minimum implementation of a tenant store.
Namespace: Talegen.AspNetCore.Multitenant
Assembly: Talegen.AspNetCore.Multitenant.dll
Syntax
public interface ITenantStore<TTenant>
where TTenant : class, ITenant, new()
Type Parameters
Name | Description |
---|---|
TTenant | The type of the tenant. |
Methods
| Improve this Doc View SourceAllTenantsAsync(CancellationToken)
Returns all of the tenants from the cache storage.
Declaration
Task<List<TTenant>> AllTenantsAsync(CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Contains an optional cancellation token. |
Returns
Type | Description |
---|---|
Task<List<TTenant>> | Returns a list of all tenants found in the cache storage. |
GetByIdentifierAsync(String, CancellationToken)
Tries the get the tenant record by the tenant identifier asynchronously.
Declaration
Task<TTenant> GetByIdentifierAsync(string identifier, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | identifier | The tenant identifier to find. |
CancellationToken | cancellationToken | Contains an optional cancellation token. |
Returns
Type | Description |
---|---|
Task<TTenant> | Returns The tenant record if found. |
TryAddAsync(TTenant, CancellationToken)
Tries to add a new Tenant to the cache storage.
Declaration
Task<bool> TryAddAsync(TTenant tenantInfo, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TTenant | tenantInfo | The tenant information to add. |
CancellationToken | cancellationToken | Contains an optional cancellation token. |
Returns
Type | Description |
---|---|
Task<System.Boolean> | Returns a value indicating whether the record was added. |