| | | 1 | | namespace ZhEaIsNsAaBn.DbSeeder; |
| | | 2 | | |
| | | 3 | | /// <summary>One column a seed migration writes or matches on, from the EF model.</summary> |
| | | 4 | | public sealed class SeedColumn |
| | | 5 | | { |
| | | 6 | | /// <summary>The EF property (shadow properties included); providers read their own annotations from it.</summary> |
| | | 7 | | public required IProperty Property { get; init; } |
| | | 8 | | |
| | | 9 | | /// <summary>The EF property name, as used in the data files.</summary> |
| | 25090 | 10 | | public string PropertyName => Property.Name; |
| | | 11 | | |
| | | 12 | | /// <summary>The column name in the table.</summary> |
| | | 13 | | public required string ColumnName { get; init; } |
| | | 14 | | |
| | | 15 | | /// <summary>The CLR type of the stored value, after the EF value converter (e.g. <see cref="string"/> for a convert |
| | | 16 | | public required Type ProviderClrType { get; init; } |
| | | 17 | | |
| | | 18 | | /// <summary>The store type, e.g. <c>nvarchar(50)</c>.</summary> |
| | | 19 | | public required string StoreType { get; init; } |
| | | 20 | | |
| | | 21 | | /// <summary>Whether the column accepts <c>NULL</c>.</summary> |
| | 475 | 22 | | public bool IsNullable => Property.IsColumnNullable(); |
| | | 23 | | |
| | | 24 | | |
| | | 25 | | /// <inheritdoc /> |
| | 0 | 26 | | public override string ToString() => ColumnName; |
| | | 27 | | } |