JsonHelperReadAppSettings Method
Returns a collection of settings from a Json application settings file.
Namespace: Common.Core.ClassesAssembly: Common.Core (in Common.Core.dll) Version: 2.1.5
public static Dictionary<string, string?> ReadAppSettings(
ref string fileName,
ref string?? section,
int maxDepth = 2
)
- fileName String
- Json application settings file name.
- section String
- Application settings section to return (case-sensitive).
- maxDepth Int32 (Optional)
- Maximum depth allowed when parsing JSON data.
DictionaryString,
StringAn empty collection is returned if the settings section could not be found.
If no section is provided it is assumed that the settings are in the root.
Otherwise it is assumed that the section name is case-sensitive and only 3 levels deep.