I have little problem with deserialization. In variable test I get null. Other thing how return correct json in method.
*In picture I cast to object but normally I cast to ClaimValue :)
Have you got any idea what I made wrong?
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; }
}