0
我沒有什麼問題反序列化。在變量測試中,我得到空值。其他方法如何在方法中返回正確的json。SerializeObject,DeserializeObject並返回Json
*在我的圖片轉換爲對象,但通常我投來ClaimValue :)
你有我做了什麼錯什麼想法?
foreach (var claim in claims)
{
claimValues.Add(new ClaimValue { Type = claim.Type, Value = claim.Value, ValueType = claim.ValueType });
}
string json = JsonConvert.SerializeObject(new
{
results = claimValues
});
var test = JsonConvert.DeserializeObject<ClaimValue>(json);
return json;
}
}
public class ClaimValue
{
public string Value { get; set; }
public string ValueType { get; set; }
public string Type { get; set; }
}
6分鐘:)我會接受你的回答:)謝謝! –