Untitled

Anonymous
csharp
12/08/2022 6:37 PM
508 B
25
Indexable
        if (!File.Exists(path))
            throw new ArgumentException($"Config file cannot be found at path '{path}'.");
        var content = File.ReadAllText(path);

        var config = JsonConvert.DeserializeObject<Config>(content);
        if (config == null) {
            throw new ArgumentException($"Argument 'json' has an invalid value: '{json}'.");
        }
Editor is loading...