I populate a class using Json.Net like this:
var account = JsonConvert.DeserializeObject<Account>(result.ToString());
The result JSON string above populates a couple of properties in my Account
class. I later have a new JSON string and want to populate the same Account
class with the remaining properties. Is this possible using JSON.NET or a JsonConvert
method? I basically want to append/add to the account object I've populated in the line of code above.
My class:
public class Account
{
public string CID { get; set; }
public string jsonrpc { get; set; }
public string id { get; set; }
public List<string> mail { get; set; }
public List<string> uid { get; set; }
public List<string> userPassword { get; set; }
}
See Question&Answers more detail:os