cleare unused tojson function
This commit is contained in:
parent
d9de727c41
commit
b6b1cfccb9
|
|
@ -32,24 +32,4 @@ public record StatusRecord
|
|||
public required EssControl EssControl { get; set; } // TODO: init only
|
||||
public required StateMachine StateMachine { get; init; }
|
||||
|
||||
|
||||
public string ToJson()
|
||||
{
|
||||
// Try to get the "Battery" property via reflection
|
||||
// var batteryProperty = thing.GetType().GetProperty("Battery");
|
||||
// if (batteryProperty == null)
|
||||
// throw new InvalidOperationException("The object does not have a 'Battery' property.");
|
||||
//
|
||||
// // Retrieve the value of the Battery property
|
||||
// var batteryValue = Battery.GetValue(thing);
|
||||
var jsonOptions = new JsonSerializerOptions { WriteIndented = true };
|
||||
|
||||
// Serialize the Battery property
|
||||
Console.WriteLine("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
|
||||
string json = JsonSerializer.Serialize(this.Battery, jsonOptions);
|
||||
Console.WriteLine(json);
|
||||
|
||||
|
||||
return json;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue