Construct JSON payload C#

Rorbywwg

New Member
I have the following table:
09DvY.png
I'd like to execute a LINQ Query that serializes:JSON:\[code\]{ "product-list": { "products": [ { "P_Flavor": [ "Berry", "Cedar", "Cherry", "Coffee" ], "P_Winery": [ "Lyeth" ], "P_Body": [ "Elegant", "Firm", "Firm Tannins", "Polished", "Supple", "Tannins" ], "P_Name": "A Red Blend", "P_DateReviewed": "08/31/95", "P_WineID": 34699, "P_Score": 5, } ] }}\[/code\]I would normally use \[code\]JavaScriptSerializer\[/code\] to do this, however I would like to construct my own JSON payload.\[code\]IList<record_property> recList = (from c in entities.record_property select c).ToList();var json = new JavaScriptSerializer().Serialize(recList);\[/code\]What would be the best way to do this?
 
Back
Top