# WorkflowDefinitionStoreContract

> 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.testing.contracts.storage.workflowdefinitionstorecontract/
> Summary: WorkflowDefinitionStoreContract: Behavior tests for the IWorkflowDefinitionStore contract.

<div class="api-provenance">Namespace Tracon.Testing.Contracts.Storage · Assembly <code>Tracon.Testing.Contracts.Xunit.dll</code></div>

Behavior tests for the [IWorkflowDefinitionStore](/api/tracon.iworkflowdefinitionstore/) contract.

```csharp
public abstract class WorkflowDefinitionStoreContract : TenantIsolationContract<IWorkflowDefinitionStore>, IAsyncLifetime, IAsyncDisposable
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;</a> ← <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;</a> ← <a href="/api/tracon.testing.contracts.storage.workflowdefinitionstorecontract/">WorkflowDefinitionStoreContract</a></dd><dt>Implements</dt><dd>IAsyncLifetime, <a href="https://learn.microsoft.com/dotnet/api/system.iasyncdisposable">IAsyncDisposable</a></dd><dt>Inherited Members</dt><dd><a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TenantA">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.TenantA</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TenantB">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.TenantB</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_UseAmbientTenant_Tracon_Testing_Contracts_Storage_MutableTenantContext_">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.UseAmbientTenant(MutableTenantContext)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_SeedAsync_System_String_System_String_System_Threading_CancellationToken_">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.SeedAsync(string, string, CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_ExistsAsync_System_String_System_Object_">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.ExistsAsync(string, object)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_CountAsync_System_String_System_Threading_CancellationToken_">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.CountAsync(string, CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TryDeleteAsync_System_String_System_Object_">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.TryDeleteAsync(string, object)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_TryOverwriteAsync_System_String_System_String_">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.TryOverwriteAsync(string, string)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_CancellableReadAsync_System_Threading_CancellationToken_">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.CancellableReadAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_CancellableWriteAsync_System_Threading_CancellationToken_">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.CancellableWriteAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_WroteAnythingAsync">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.WroteAnythingAsync()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_cannot_read_another_tenants_record">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.Tenant_cannot_read_another_tenants_record()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_reads_its_own_record">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.Tenant_reads_its_own_record()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_does_not_see_another_tenants_record_in_the_list">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.Tenant_does_not_see_another_tenants_record_in_the_list()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Tenant_cannot_delete_another_tenants_record">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.Tenant_cannot_delete_another_tenants_record()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_Same_name_lives_independently_across_two_tenants">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.Same_name_lives_independently_across_two_tenants()</a>, <a href="/api/tracon.testing.contracts.storage.tenantisolationcontract-1/#Tracon_Testing_Contracts_Storage_TenantIsolationContract_1_AmbientTenant">TenantIsolationContract&lt;IWorkflowDefinitionStore&gt;.AmbientTenant</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CreateStoreAsync">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;.CreateStoreAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_InitializeAsync">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;.InitializeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_DisposeAsync">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;.DisposeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_OnDisposeAsync">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;.OnDisposeAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CancellableReadAsync_System_Threading_CancellationToken_">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;.CancellableReadAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_CancellableWriteAsync_System_Threading_CancellationToken_">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;.CancellableWriteAsync(CancellationToken)</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_WroteAnythingAsync">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;.WroteAnythingAsync()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_Canceled_token_throws_on_read">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;.Canceled_token_throws_on_read()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_The_write_this_contract_checks_can_be_read_back">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;.The_write_this_contract_checks_can_be_read_back()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_Canceled_token_throws_on_write_and_leaves_no_trace">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;.Canceled_token_throws_on_write_and_leaves_no_trace()</a>, <a href="/api/tracon.testing.contracts.storage.storecancellationcontract-1/#Tracon_Testing_Contracts_Storage_StoreCancellationContract_1_Store">StoreCancellationContract&lt;IWorkflowDefinitionStore&gt;.Store</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

The in-memory store and the SQL stores must pass the same
scenarios. In particular, version increment, version history and tenant isolation must
behave identically in all of them.

## Constructors

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract__ctor"></a> WorkflowDefinitionStoreContract\(\)

```csharp
protected WorkflowDefinitionStoreContract()
```

## Properties

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_QualifiedWorkflowHistoryTable"></a> QualifiedWorkflowHistoryTable

The fully qualified `workflow_definition_versions` table reference this provider's raw SQL should use.

```csharp
protected virtual string QualifiedWorkflowHistoryTable { get; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_RawNowExpression"></a> RawNowExpression

The expression this provider's raw SQL uses for "now" in a timestamp column.

```csharp
protected virtual string RawNowExpression { get; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_SupportsRawHistory"></a> SupportsRawHistory

Whether the backing state of this store can be reached with raw SQL (SQL providers only).

```csharp
protected virtual bool SupportsRawHistory { get; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

## Methods

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_A_rollback_of_a_deleted_definition_creates_it_again_and_continues_the_numbering"></a> A\_rollback\_of\_a\_deleted\_definition\_creates\_it\_again\_and\_continues\_the\_numbering\(\)

```csharp
[Fact]
public Task A_rollback_of_a_deleted_definition_creates_it_again_and_continues_the_numbering()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_A_rollback_to_a_version_that_does_not_exist_throws_and_writes_nothing"></a> A\_rollback\_to\_a\_version\_that\_does\_not\_exist\_throws\_and\_writes\_nothing\(\)

```csharp
[Fact]
public Task A_rollback_to_a_version_that_does_not_exist_throws_and_writes_nothing()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_A_rollback_writes_the_old_content_as_a_new_version_and_moves_nothing"></a> A\_rollback\_writes\_the\_old\_content\_as\_a\_new\_version\_and\_moves\_nothing\(\)

```csharp
[Fact]
public Task A_rollback_writes_the_old_content_as_a_new_version_and_moves_nothing()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_A_save_whose_history_write_fails_leaves_the_current_definition_as_it_was"></a> A\_save\_whose\_history\_write\_fails\_leaves\_the\_current\_definition\_as\_it\_was\(\)

```csharp
[Fact]
public Task A_save_whose_history_write_fails_leaves_the_current_definition_as_it_was()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_A_version_or_a_history_that_does_not_exist_is_empty_not_an_error"></a> A\_version\_or\_a\_history\_that\_does\_not\_exist\_is\_empty\_not\_an\_error\(\)

```csharp
[Fact]
public Task A_version_or_a_history_that_does_not_exist_is_empty_not_an_error()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Agent_version_pins_survive_the_round_trip"></a> Agent\_version\_pins\_survive\_the\_round\_trip\(\)

```csharp
[Fact]
public Task Agent_version_pins_survive_the_round_trip()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_All_fields_survive_the_round_trip"></a> All\_fields\_survive\_the\_round\_trip\(\)

```csharp
[Fact]
public Task All_fields_survive_the_round_trip()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Another_tenant_neither_reads_nor_rolls_back_nor_numbers_with_this_tenants_history"></a> Another\_tenant\_neither\_reads\_nor\_rolls\_back\_nor\_numbers\_with\_this\_tenants\_history\(\)

```csharp
[Fact]
public Task Another_tenant_neither_reads_nor_rolls_back_nor_numbers_with_this_tenants_history()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Another_tenants_definition_is_not_visible"></a> Another\_tenants\_definition\_is\_not\_visible\(\)

```csharp
[Fact]
public Task Another_tenants_definition_is_not_visible()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Concurrent_saves_of_one_name_get_distinct_versions_and_each_keeps_its_own_content"></a> Concurrent\_saves\_of\_one\_name\_get\_distinct\_versions\_and\_each\_keeps\_its\_own\_content\(\)

```csharp
[Fact]
public Task Concurrent_saves_of_one_name_get_distinct_versions_and_each_keeps_its_own_content()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_CountAsync_System_String_System_Threading_CancellationToken_"></a> CountAsync\(string, CancellationToken\)

Reports how many records the given tenant sees through the listing endpoint.

```csharp
protected override ValueTask<int> CountAsync(string tenantId, CancellationToken cancellationToken)
```

#### Parameters

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

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The token every store call inside the hook must be handed; see
[TenantIsolationContract.SeedAsync](/api/tracon.testing.contracts.storage/).

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\>

The number of records seen.

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Deleted_definition_is_not_read_back"></a> Deleted\_definition\_is\_not\_read\_back\(\)

```csharp
[Fact]
public Task Deleted_definition_is_not_read_back()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Deleting_a_definition_that_does_not_exist_leaves_the_history_alone"></a> Deleting\_a\_definition\_that\_does\_not\_exist\_leaves\_the\_history\_alone\(\)

```csharp
[Fact]
public Task Deleting_a_definition_that_does_not_exist_leaves_the_history_alone()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Deleting_a_nonexistent_definition_returns_false"></a> Deleting\_a\_nonexistent\_definition\_returns\_false\(\)

```csharp
[Fact]
public Task Deleting_a_nonexistent_definition_returns_false()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Deleting_keeps_the_history_and_the_numbering_continues_after_it"></a> Deleting\_keeps\_the\_history\_and\_the\_numbering\_continues\_after\_it\(\)

```csharp
[Fact]
public Task Deleting_keeps_the_history_and_the_numbering_continues_after_it()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Every_field_of_a_definition_is_kept_by_the_version_it_was_saved_as"></a> Every\_field\_of\_a\_definition\_is\_kept\_by\_the\_version\_it\_was\_saved\_as\(\)

```csharp
[Fact]
public Task Every_field_of_a_definition_is_kept_by_the_version_it_was_saved_as()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Every_save_increments_the_version"></a> Every\_save\_increments\_the\_version\(\)

```csharp
[Fact]
public Task Every_save_increments_the_version()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Every_save_keeps_its_version_and_the_history_lists_them_newest_first"></a> Every\_save\_keeps\_its\_version\_and\_the\_history\_lists\_them\_newest\_first\(\)

```csharp
[Fact]
public Task Every_save_keeps_its_version_and_the_history_lists_them_newest_first()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_ExecuteRawAsync_System_String_"></a> ExecuteRawAsync\(string\)

Runs raw SQL against the backing store. Only called when [WorkflowDefinitionStoreContract.SupportsRawHistory](/api/tracon.testing.contracts.storage.workflowdefinitionstorecontract/#Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_SupportsRawHistory) is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool).

```csharp
protected virtual ValueTask ExecuteRawAsync(string sql)
```

#### Parameters

`sql` [string](https://learn.microsoft.com/dotnet/api/system.string)

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_ExistsAsync_System_String_System_Object_"></a> ExistsAsync\(string, object\)

Reports whether the record is visible from the given tenant's viewpoint.

```csharp
protected override ValueTask<bool> ExistsAsync(string tenantId, object key)
```

#### Parameters

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

`key` [object](https://learn.microsoft.com/dotnet/api/system.object)

The key returned by [TenantIsolationContract.SeedAsync](/api/tracon.testing.contracts.storage/).

#### 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 is visible.

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Function_node_settings_survive_the_round_trip"></a> Function\_node\_settings\_survive\_the\_round\_trip\(\)

```csharp
[Fact]
public Task Function_node_settings_survive_the_round_trip()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Incoming_version_value_is_ignored"></a> Incoming\_version\_value\_is\_ignored\(\)

```csharp
[Fact]
public Task Incoming_version_value_is_ignored()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Listing_is_sorted_by_name"></a> Listing\_is\_sorted\_by\_name\(\)

```csharp
[Fact]
public Task Listing_is_sorted_by_name()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Magentic_manager_name_is_preserved"></a> Magentic\_manager\_name\_is\_preserved\(\)

```csharp
[Fact]
public Task Magentic_manager_name_is_preserved()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Node_list_survives_the_round_trip"></a> Node\_list\_survives\_the\_round\_trip\(\)

```csharp
[Fact]
public Task Node_list_survives_the_round_trip()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Node_timeouts_and_the_run_timeout_survive_the_round_trip"></a> Node\_timeouts\_and\_the\_run\_timeout\_survive\_the\_round\_trip\(\)

```csharp
[Fact]
public Task Node_timeouts_and_the_run_timeout_survive_the_round_trip()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Parameter_schema_survives_the_round_trip"></a> Parameter\_schema\_survives\_the\_round\_trip\(\)

```csharp
[Fact]
public Task Parameter_schema_survives_the_round_trip()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Same_name_is_independent_across_tenants"></a> Same\_name\_is\_independent\_across\_tenants\(\)

```csharp
[Fact]
public Task Same_name_is_independent_across_tenants()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Saved_definition_is_read_back"></a> Saved\_definition\_is\_read\_back\(\)

```csharp
[Fact]
public Task Saved_definition_is_read_back()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Saving_again_without_node_settings_clears_them"></a> Saving\_again\_without\_node\_settings\_clears\_them\(\)

```csharp
[Fact]
public Task Saving_again_without_node_settings_clears_them()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_Saving_again_without_timeouts_clears_them"></a> Saving\_again\_without\_timeouts\_clears\_them\(\)

```csharp
[Fact]
public Task Saving_again_without_timeouts_clears_them()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_SeedAsync_System_String_System_String_System_Threading_CancellationToken_"></a> SeedAsync\(string, string, CancellationToken\)

Writes a sample record for the given tenant.

```csharp
protected override ValueTask<object> SeedAsync(string tenantId, string name, CancellationToken cancellationToken)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The tenant that owns the record.

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name distinguishing the record. The same name may be used by two tenants.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The token every store call inside the hook must be handed. The
cancellation contract calls this hook with a token that is already
cancelled, so a hook that drops the token reports a store as sound
when it is not.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[object](https://learn.microsoft.com/dotnet/api/system.object)\>

The key to use for reading the record back.

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_The_new_members_refuse_a_cancelled_token_and_a_cancelled_rollback_leaves_no_trace"></a> The\_new\_members\_refuse\_a\_cancelled\_token\_and\_a\_cancelled\_rollback\_leaves\_no\_trace\(\)

```csharp
[Fact]
public Task The_new_members_refuse_a_cancelled_token_and_a_cancelled_rollback_leaves_no_trace()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_The_request_timeout_survives_the_round_trip"></a> The\_request\_timeout\_survives\_the\_round\_trip\(\)

```csharp
[Fact]
public Task The_request_timeout_survives_the_round_trip()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_The_response_mode_survives_the_round_trip"></a> The\_response\_mode\_survives\_the\_round\_trip\(\)

```csharp
[Fact]
public Task The_response_mode_survives_the_round_trip()
```

#### Returns

 [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### <a id="Tracon_Testing_Contracts_Storage_WorkflowDefinitionStoreContract_TryDeleteAsync_System_String_System_Object_"></a> TryDeleteAsync\(string, object\)

Attempts to delete the record on behalf of the given tenant.

```csharp
protected override ValueTask<bool?> TryDeleteAsync(string tenantId, object key)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The tenant attempting the delete.

`key` [object](https://learn.microsoft.com/dotnet/api/system.object)

The key returned by [TenantIsolationContract.SeedAsync](/api/tracon.testing.contracts.storage/).

#### 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 delete succeeded, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool)
if the record was not found; [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) if the store does
not offer deletion.
