Following is my javascript array which I am passing from the server.
string request = @"[[1,""Name"",""Sam"",""20""],1,""Name"",""Ram"",""20""]]";
I want to convert it into a List of C# object.
public class UpdateData
{
public int RowID { get; set; }
public string ColumnName { get; set; }
public string OldValue { get; set; }
public string NewValue { get; set; }
}
Is there a way to do that?
First get a List of Lists and then loop over it to form your List of UpdateData (using Json.Net)
var obj = JsonConvert.DeserializeObject <List<List<object>>>(request);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With