public JsonCycloneDx ToJson(string filePath) { try { using var stream = new StreamReader(filePath); return(JsonCycloneDx.FromJson(stream.ReadToEnd()) ?? throw new InvalidOperationException()); } catch (IOException) { throw new ArgumentException("Can not read file, location given: " + filePath); } }
public JsonCycloneDx ToJson(string filePath) => JsonCycloneDx.FromJson(_jsonString) ?? throw new InvalidOperationException();