| | | 1 | | namespace ZhEaIsNsAaBn.DbSeeder; |
| | | 2 | | |
| | | 3 | | /// <summary>A table a seed migration touches, resolved from the EF model and the seed configuration.</summary> |
| | | 4 | | public sealed class SeedTable |
| | | 5 | | { |
| | | 6 | | /// <summary>The EF entity type mapped to the table.</summary> |
| | | 7 | | public required IEntityType EntityType { get; init; } |
| | | 8 | | |
| | | 9 | | /// <summary>The schema; <see langword="null"/> for the database default.</summary> |
| | | 10 | | public required string? Schema { get; init; } |
| | | 11 | | |
| | | 12 | | /// <summary>The table name.</summary> |
| | | 13 | | public required string Name { get; init; } |
| | | 14 | | |
| | | 15 | | /// <summary>The columns that identify a row: the primary key, or the unique <c>MatchBy</c> key. In data-file order. |
| | | 16 | | public required IReadOnlyList<SeedColumn> MatchColumns { get; init; } |
| | | 17 | | |
| | | 18 | | /// <summary>The soft-delete flag column; <see langword="null"/> when the entity has none.</summary> |
| | | 19 | | public required SeedColumn? SoftDeleteFlag { get; init; } |
| | | 20 | | |
| | | 21 | | |
| | | 22 | | /// <summary>The table name with its schema, for messages: <c>dbo.Country</c> or <c>Country</c>.</summary> |
| | 285 | 23 | | public string DisplayName => Schema is null ? Name : $"{Schema}.{Name}"; |
| | | 24 | | |
| | | 25 | | |
| | | 26 | | /// <inheritdoc /> |
| | 0 | 27 | | public override string ToString() => DisplayName; |
| | | 28 | | } |