using System.Text.Json.Nodes; namespace InnovEnergy.Lib.StatusApi; public record Phase : IPhase { public Double Voltage { get; init; } public Double Current { get; init; } public JsonNode ToJson() { var jsonDict = new Dictionary { [nameof(Voltage)] = Voltage, [nameof(Current)] = Current }; return new JsonObject(jsonDict!); } }