I have a complex object as follow
public class Cart
{
public int cartID{get; set;}
public bool IsActive{get; set;}
public double price{get; set;}
public List<Items> items{get; set;}
}
public class Item
{
public int itemID{get; set;}}
public string itemName{get;set;}
public double price{get; set;}
}
My service accepts a json as follows
public class ServiceRequest
{
public string Data{get;set;}
public string ActionToBePerformed{get;set;}
}
where ActionToBePerformed- indicate which operation to perform.
Data- is the serialized list of object Cart
How to serialize the Cart object into string in windows phone 7 and send it to the service as Data of object ServiceRequest?(without using any third party JSON library as JSON.net)