Stack Exchange
C#: Json.NET --> Json back to an object
I am using the Json.Net Libary. and i am having trouble with getting the JSON object back in to my c# objects.
I currently have:
JSON
[{"Datum":"31-05-2012","Naam":"KN: xxxx","Prijs":"37","Id":31123,"status":"found","foundPrice":"37.50","betaald":"2012-06-01","ingepakt":"2012-06-03","geanuleerd":"nee","verstuurd":"nee","achternaam":"xxxx","straat":"xxxx 98","postcode":"4422xx","plaats":"xxxxx","land":"Nederland","gewicht":"0.600"},{"Datum":"31-05-2012","Naam":"xxxxT","Prijs":"23","Id":31341,"status":"found","foundPrice":"23.00","betaald":"2012-06-01","ingepakt":"2012-06-03","geanuleerd":"nee","verstuurd":"nee","achternaam":"xxxx","straat":"de xxxxx 2","postcode":"4444xx","plaats":"xxxx","land":"Nederland","gewicht":"0.300"}]

and the object:
public class OrderObject
{
    public string Datum, Naam, Prijs;
    public int Id;
    public string status;
    public string foundPrice;
    public string betaald;
    public string ingepakt;
    public string geanuleerd;
    public string verstuurd;
    public string achternaam;
    public string straat;
    public string postcode;
    public string plaats;
    public string land;
    public string gewicht;
}

To make a list of these objects to JSON i only needed:
private void sentToServer(List<OrderObject> input )
        {
            var inputJson = JsonConvert.SerializeObject(input); 
        }

But what do i need to do for the reverse proces?
can anyone help me?
Thx
Matthy

 var result = JsonConvert.DeserializeObject<List<OrderObject>>(inputJson);


Thx alot it worked i tried //var Jspnoutput = JsonConvert.DeserializeObject(output); so close but yet so far

Try the reciprocal method to SerializeObject which is DeserializeObject:
List<OrderObject> list = JsonConvert.DeserializeObject<List<OrderObject>>(inputJson);

