BuildsAppReborn.Contracts.Extensions.BuildProviderSettingsExtensions.ThrowIfKeyNotExists C# (CSharp) Метод

ThrowIfKeyNotExists() публичный статический Метод

public static ThrowIfKeyNotExists ( BuildMonitorSettings settings, String key ) : void
settings BuildMonitorSettings
key String
Результат void
        public static void ThrowIfKeyNotExists(this BuildMonitorSettings settings, String key)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            if (String.IsNullOrWhiteSpace(key))
            {
                throw new ArgumentNullException(nameof(key));
            }

            if (!settings.ContainsKey(key))
            {
                throw new KeyNotFoundException($"Required key {key} not found in settings!");
            }
        }