using System.Text.Json.Nodes; namespace InnovEnergy.Lib.StatusApi; public record AcPhase : IAcPhase { // Note: only inherit from interfaces in order to make JSON serialization work public Double Phi { get; init;} public Double Voltage { get; init;} public Double Current { get; init;} public JsonNode ToJson() { var jsonDict = new Dictionary(); jsonDict[nameof(Phi)] = Phi; jsonDict[nameof(Voltage)] = Voltage; jsonDict[nameof(Current)] = Current; return new JsonObject(jsonDict!); } }