25'ten fazla konu seçemezsiniz
Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
|
- namespace Campaign_Tracker.Server.LegacyData.Schema;
-
- /// <summary>
- /// Abstraction for reading the *current* legacy schema at runtime.
- ///
- /// In production this is implemented against the live Access database (OleDb
- /// schema rowsets). In development and testing it is implemented in-memory and
- /// seeded from the baseline so the default state is "no drift". Tests inject
- /// mutated inspectors to simulate drift.
- /// </summary>
- public interface ILegacySchemaInspector
- {
- Task<IReadOnlyList<LegacyTableDefinition>> GetCurrentSchemaAsync(
- CancellationToken cancellationToken = default);
- }
-
- /// <summary>
- /// Default development/test inspector. Returns whatever table list it was
- /// constructed with (defaulting to the baseline tables — no drift).
- /// </summary>
- public sealed class InMemoryLegacySchemaInspector : ILegacySchemaInspector
- {
- private readonly IReadOnlyList<LegacyTableDefinition> _tables;
-
- public InMemoryLegacySchemaInspector(IReadOnlyList<LegacyTableDefinition> tables)
- {
- _tables = tables ?? throw new ArgumentNullException(nameof(tables));
- }
-
- public Task<IReadOnlyList<LegacyTableDefinition>> GetCurrentSchemaAsync(
- CancellationToken cancellationToken = default) =>
- Task.FromResult(_tables);
- }
|