| | | 1 | | namespace ZhEaIsNsAaBn.APPSettings; |
| | | 2 | | |
| | | 3 | | /// <summary>Configuration source for settings stored in a database table. Added by <c>AddEFConfiguration( … ).Build( … |
| | | 4 | | /// <typeparam name="TSettingsTable">The settings entity.</typeparam> |
| | | 5 | | /// <typeparam name="TDbContext">The context that holds the settings table.</typeparam> |
| | | 6 | | public sealed class EFConfigurationSource< TSettingsTable, TDbContext > : IConfigurationSource |
| | | 7 | | where TSettingsTable : class, IEFConfigurationValue, new() |
| | | 8 | | where TDbContext : DbContext |
| | | 9 | | { |
| | | 10 | | private readonly EFConfigurationProviderSettings<TSettingsTable, TDbContext> _settings; |
| | | 11 | | |
| | | 12 | | |
| | | 13 | | /// <summary>Creates the source.</summary> |
| | | 14 | | /// <param name="settings">The provider settings.</param> |
| | | 15 | | /// <exception cref="ArgumentNullException"><paramref name="settings"/> is <see langword="null"/>.</exception> |
| | 48 | 16 | | public EFConfigurationSource( EFConfigurationProviderSettings<TSettingsTable, TDbContext> settings ) |
| | 48 | 17 | | => _settings = settings ?? throw new ArgumentNullException( nameof( settings ) ); |
| | | 18 | | |
| | | 19 | | |
| | | 20 | | /// <inheritdoc /> |
| | 44 | 21 | | public IConfigurationProvider Build( IConfigurationBuilder builder ) => new EFConfigurationProvider<TSettingsTable, |
| | | 22 | | } |