/// <summary> /// Gets the shard set setting value. /// </summary> /// <param name="settingKey">The setting key.</param> /// <returns>System.String.</returns> /// <exception cref="KeyNotFoundException"> if the key does not exist</exception> public string GetShardSetSetting(string settingKey) { var setting = ShardSetConfigSettings .FirstOrDefault(wgcs => wgcs.SettingKey == settingKey); if (setting == null) { throw new KeyNotFoundException(string.Format("Missing setting '{0}' from work load group settings", settingKey)); } return(setting.SettingValue); }
/// <summary> /// Sets the shard set setting value. /// </summary> /// <param name="settingKey">The setting key.</param> /// <param name="settingValue">The setting value.</param> public void SetShardSetSetting(string settingKey, string settingValue) { var setting = ShardSetConfigSettings .FirstOrDefault(wgcs => wgcs.SettingKey == settingKey); if (setting == null) { setting = new ShardSetConfigSetting { SettingKey = settingKey, SettingValue = settingValue, }; ShardSetConfigSettings.Add(setting); } else { setting.SettingValue = settingValue; } }