예제 #1
0
 /// <summary>
 ///     Extracts the value with the specified key and converts it to type T. bob 2019-07-08
 /// </summary>
 /// <typeparam name="T">The type to convert the value to.</typeparam>
 /// <param name="key">The key of the configuration section's value to convert.</param>
 /// <param name="defaultValue">The default value to use if no value is found.</param>
 /// <returns>The converted value.</returns>
 public static T GetValue <T>(string key, T defaultValue) => ConfigRoot == null ? defaultValue : ConfigRoot.GetValue(key, defaultValue);
예제 #2
0
 /// <summary>
 ///     Extracts the value with the specified key and converts it to type T. bob 2019-07-08
 /// </summary>
 /// <typeparam name="T">The type to convert the value to.</typeparam>
 /// <param name="key">The key of the configuration section's value to convert.</param>
 /// <returns>The converted value.</returns>
 public static T GetValue <T>(string key) => ConfigRoot.GetValue <T>(key);
예제 #3
0
 /// <summary>
 ///     Extracts the value with the specified key and converts it to type string. bob 2019-07-08
 /// </summary>
 /// <param name="key">The key of the configuration section's value to convert.</param>
 /// <returns>The converted value.</returns>
 public static string GetValue(string key) => ConfigRoot.GetValue <string>(key);