/// <summary> /// Gets list of values from environment\setting file or empty List if path doesn't exist in file and environment variables. /// Exception will not be threw. /// </summary> /// <typeparam name="T">Type of a value.</typeparam> /// <param name="file">Settings file.</param> /// <param name="path">Path to a value. Depends on file format, it can be xpath, path etc.</param> /// <returns>List of values or empty List.</returns> public static IReadOnlyList <T> GetValueListOrEmpty <T>(this ISettingsFile file, string path) { return(file.IsValuePresent(path) ? file.GetValueList <T>(path) : new List <T>()); }