Hi,
I have a class
public class Employee
{
public string EmpId { get; set; }
public string EmpName { get; set; }
public int Age { get; set; }
public string[] qualification { get; set; }
}
And Json File
===========
[{ "empid": 53931, "empname": "Sundar", "age": "42", "qualification": [],
"empid": 53932, "empname": "Ramu", "age": "44", "qualification": []}
my program to read json file
=======================
var jsonData = System.IO.File.ReadAllText(fullPath);
var readData = JsonConvert.DeserializeObject>(jsonData);
The readData doesn't bind values to the qualification
Employee.empid Employee.empname Employee.age
53951 Sundear 42
53952 Ramu 44
Janardhana Rao KotagiriPosted Nov 4, 2022, 11:48 AM
Hi Sachin,
Thank you very much for your response. I'll check
Sachin SinghPosted Nov 4, 2022, 10:21 AM
As per your given Json your class structure is wrong it should be
credit :- https://json2csharp.com/