Код: Выделить всё
{
"Type": "Service",
"Uid": "Bridge 1",
"ServiceName": "Bridge 1"
}
Код: Выделить всё
public record ServiceConfig
{
public required string Type { get; init; }
public required string Uid { get; init; }
public required string ServiceName { get; init; }
}
Код: Выделить всё
var cfg = System.Text.Json.JsonSerializer.Deserialize(stream);
Код: Выделить всё
{
"Type": "Service",
"Uid": "Bridge 1",
"ServiceName": "Bridge 1"
},
{
"Type": "Service",
"Uid": "Bridge 1"
},
Подробнее здесь: https://stackoverflow.com/questions/790 ... erializing