# ITenantStore

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.itenantstore/
> Summary: ITenantStore: The store for tenant registrations.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

The store for tenant registrations.

```csharp
public interface ITenantStore
```

## Methods

### <a id="Tracon_ITenantStore_DeleteAsync_System_String_System_Threading_CancellationToken_"></a> DeleteAsync\(string, CancellationToken\)

Deletes a tenant registration. The tenant's data is not deleted.

```csharp
ValueTask<bool> DeleteAsync(string slug, CancellationToken cancellationToken = default)
```

#### Parameters

`slug` [string](https://learn.microsoft.com/dotnet/api/system.string)

The tenant key.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\>

[true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the record was deleted.

### <a id="Tracon_ITenantStore_ListAsync_System_Threading_CancellationToken_"></a> ListAsync\(CancellationToken\)

Lists registered tenants, ordered by key.

```csharp
ValueTask<IReadOnlyList<TenantDescriptor>> ListAsync(CancellationToken cancellationToken = default)
```

#### Parameters

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[TenantDescriptor](/api/tracon.tenantdescriptor/)\>\>

The tenants.

### <a id="Tracon_ITenantStore_SaveAsync_Tracon_TenantDescriptor_System_Threading_CancellationToken_"></a> SaveAsync\(TenantDescriptor, CancellationToken\)

Adds or updates a tenant. The key is [TenantDescriptor.Slug](/api/tracon.tenantdescriptor/#Tracon_TenantDescriptor_Slug).

```csharp
ValueTask<TenantDescriptor> SaveAsync(TenantDescriptor tenant, CancellationToken cancellationToken = default)
```

#### Parameters

`tenant` [TenantDescriptor](/api/tracon.tenantdescriptor/)

The tenant to write.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[TenantDescriptor](/api/tracon.tenantdescriptor/)\>

The persisted record.
