public DbSettingsBridge(IOptionsSnapshot <DbSettings> dbSettings, ISettingsValidator validator, IDecryptor decryptor) { _dbSettings = dbSettings ?? throw new ArgumentNullException(nameof(dbSettings)); _decryptor = decryptor ?? throw new ArgumentException(nameof(decryptor)); if (validator == null) { throw new ArgumentNullException(nameof(validator)); } if (!validator.TryValidate(dbSettings.Value, out var validationException)) { throw validationException; } }
public Executable(IHumanInterface ux, IFileExtensionPresenter fileExtensionPresenter, IDirectoryDescendentFilesEvaluator directoryDescendentFilesEvaluator, IListPresenter listPresenter, IFilteredFilesPresenter filteredFilesPresenter, IFilteredFilesStatsPresenter filteredFilesStatsPresenter, ICssStatsPresenter cssStatsPresenter, IJavaScriptStatsPresenter javaScriptStatsPresenter, IFilteredFilesEvaluator filteredFilesEvaluator, IJavaScriptFileStatsPresenter javaScriptFileStatsPresenter, ISettingsValidator settingsValidator, ISettingsEvaluator settingsEvaluator, IJavaScriptStatsStorageService javaScriptStatsStorageService, ICssStatsStorageService cssStatsStorageService) { CssStatsStorageService = cssStatsStorageService; JavaScriptStatsStorageService = javaScriptStatsStorageService; SettingsEvaluator = settingsEvaluator; SettingsValidator = settingsValidator; JavaScriptFileStatsPresenter = javaScriptFileStatsPresenter; FilteredFilesEvaluator = filteredFilesEvaluator; JavaScriptStatsPresenter = javaScriptStatsPresenter; CssStatsPresenter = cssStatsPresenter; FilteredFilesStatsPresenter = filteredFilesStatsPresenter; Console.SetWindowSize(Console.LargestWindowWidth, Console.LargestWindowHeight); FilteredFilesPresenter = filteredFilesPresenter; ListPresenter = listPresenter; DirectoryDescendentFilesEvaluator = directoryDescendentFilesEvaluator; FileExtensionPresenter = fileExtensionPresenter; Ux = ux; }
public SettingsController(ISettingsLogic logic, ISettingsValidator validator) { _logic = logic; _validator = validator; }
public SettingsEvaluator(ISettingsValidator settingsEvaluator) { SettingsValidator = settingsEvaluator; }
public MyAppSettingsBridge(IOptionsSnapshot <MyAppSettings> appSettings, ISettingsDecrypt decryptor, ISettingsValidator validator) { _appSettings = appSettings ?? throw new ArgumentNullException(nameof(appSettings)); _decryptor = decryptor ?? throw new ArgumentException(nameof(decryptor)); if (validator == null) { throw new ArgumentNullException(nameof(validator)); } if (!validator.TryValidate(appSettings.Value, out var validationException)) { throw validationException; } }
public MyAppSettingsBridge(IOptionsMonitor <MyAppSettings> appSettings, ISettingsDecrypt decryptor, ISettingsValidator validator) { var appSettingsUnwrapped = appSettings?.CurrentValue ?? throw new ArgumentNullException(nameof(appSettings)); if (decryptor is null) { throw new ArgumentException(nameof(decryptor)); } if (validator is null) { throw new ArgumentNullException(nameof(validator)); } if (!validator.TryValidate(appSettingsUnwrapped, out var validationException)) { throw validationException; } ApplicationName = appSettingsUnwrapped.ApplicationName; SqlConnectionSting = decryptor.Decrypt("Sql", appSettingsUnwrapped.Secrets); OracleConnectionSting = decryptor.Decrypt("Oracle", appSettingsUnwrapped.Secrets); }