0
私はNewtonSoftのJSON 4.5と次のようなJSON文字列に解析しようとしている
の値を使用します。私は、JSONにシリアライズされますプロパティ名をスキップし、のみJSON
{
"Name":"Henrik",
"Children":[
{
"Name":"Adam",
"Grandchildren":[
"Jessica", //How can i only show the value and not the property name?
"Michael"
]
}
]
}
私のオブジェクトは次のようになります。
public class Parent
{
public string Name { get; set; }
[JsonProperty(PropertyName = "Children")]
public List<Child> Childs { get; set; }
}
public class Child {
public string Name { get; set; }
[JsonProperty(PropertyName = "Grandchildren")]
public List<GrandChild> GrandChilds { get; set; }
}
public class GrandChild {
[JsonProperty(PropertyName = "")]
public string Name { get; set; }
}
プロパティ名を空に設定しようとしましたが、問題を解決しませんでした。
の可能性のある重複[Json.Net:いないオブジェクトとして、値としてプロパティをデシリアライズ/シリアライズ(https://stackoverflow.com/questions/40480489/json-net-serialize-deserialize-property-オブジェクトとして価値のないものとして) – dbc