| | 1 | | namespace Songhay.Models; |
| | 2 | |
|
| | 3 | | /// <summary> |
| | 4 | | /// Defines DBMS metadata |
| | 5 | | /// </summary> |
| | 6 | | public class DbmsMetadata |
| | 7 | | { |
| | 8 | | /// <summary> |
| | 9 | | /// Gets or sets the connection string. |
| | 10 | | /// </summary> |
| 0 | 11 | | public string? ConnectionString { get; set; } |
| | 12 | |
|
| | 13 | | /// <summary> |
| | 14 | | /// Gets or sets the connection string key. |
| | 15 | | /// </summary> |
| 0 | 16 | | public string? ConnectionStringKey { get; set; } |
| | 17 | |
|
| | 18 | | /// <summary> |
| | 19 | | /// Gets or sets the encryption metadata. |
| | 20 | | /// </summary> |
| 0 | 21 | | public EncryptionMetadata? EncryptionMetadata { get; set; } |
| | 22 | |
|
| | 23 | | /// <summary> |
| | 24 | | /// Gets or sets the name of the provider. |
| | 25 | | /// </summary> |
| 0 | 26 | | public string? ProviderName { get; set; } |
| | 27 | |
|
| | 28 | | /// <summary> |
| | 29 | | /// Returns a <see cref="String" /> that represents this instance. |
| | 30 | | /// </summary> |
| | 31 | | /// <returns> |
| | 32 | | /// A <see cref="String" /> that represents this instance. |
| | 33 | | /// </returns> |
| | 34 | | public override string ToString() |
| 0 | 35 | | { |
| 0 | 36 | | var sb = new StringBuilder(); |
| | 37 | |
|
| 0 | 38 | | if (!string.IsNullOrWhiteSpace(ProviderName)) sb.Append($"{nameof(ProviderName)}: {ProviderName} | "); |
| 0 | 39 | | if (!string.IsNullOrWhiteSpace(ConnectionString)) |
| 0 | 40 | | sb.Append($"{nameof(ConnectionString)}: {ConnectionString[..72]}... "); |
| 0 | 41 | | if (EncryptionMetadata != null) sb.Append("| has encryption metadata"); |
| | 42 | |
|
| 0 | 43 | | return (sb.Length > 0) ? sb.ToString() : base.ToString() ?? GetType().Name; |
| 0 | 44 | | } |
| | 45 | | } |