Json String doesn't deserialize


I have the following JSON:

              "funds": {
              "rights": {

I'm trying to deserialize it with:


Classes are as follows:

public class UserInfo
    public int TransactionCount { get; set; }

    public int OpenOrders { get; set; }

    public int ServerTime { get; set; }

    public Funds Funds { get; set; }

    public Rights Rights { get; set; }

public class Funds
    public decimal Btc { get; set; }

    public decimal Ltc { get; set; }

    public decimal Usd { get; set; }


public class Rights
    public bool Info { get; set; }
    public bool Trade { get; set; }
    public bool Withdraw { get; set; }

I tried not using the attributes and other tutorials, but nothing seems to work.. =(

Why doesn't it work? I don't know how to set return as a root, for example. Is it possible?

Thank you.


You don't need to create a wrapper/root class just for this, as others answers suggest.

You can parse the whole thing into a JObject, and then convert just the return node into a UserInfo object.

JObject obj = JObject.Parse(jsonStr);
var userInfo = obj["return"].ToObject<UserInfo>();

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at


Login to comment