-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIMigrationScript.cs
More file actions
35 lines (32 loc) · 1.17 KB
/
Copy pathIMigrationScript.cs
File metadata and controls
35 lines (32 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using AIKernel.Dtos.Contracts;
namespace AIKernel.Contracts;
/// <summary>
/// Applies a migration between two contract surfaces.
/// </summary>
public interface IMigrationScript
{
/// <summary>
/// Applies migration from an old contract to a new contract.
/// </summary>
/// <param name="oldContract">The source contract metadata.</param>
/// <param name="newContract">The target contract metadata.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The migration result.</returns>
ValueTask<MigrationResult> ApplyAsync(
ContractMetadata oldContract,
ContractMetadata newContract,
CancellationToken cancellationToken);
}
/// <summary>
/// Compares two contract surfaces without applying migration.
/// </summary>
public interface IContractComparer
{
/// <summary>
/// Computes a contract diff.
/// </summary>
/// <param name="oldContract">The source contract metadata.</param>
/// <param name="newContract">The target contract metadata.</param>
/// <returns>The contract diff.</returns>
ContractDiff Diff(ContractMetadata oldContract, ContractMetadata newContract);
}