Let's say I have an Employee class.
Employee
{
string Name;
int Age
}
My string contains the data of different company's employee in a string. I want deserialize it as List of Company Info. I have Company Class. Is there any solution which can deserialize multiple appended objects represented as string as following .
[{"companyName":"ABC","Employees":[{"Name":"X","Age":24},{"Name":"Y","Age":27}]}]
[{"companyName":"XYZ","Employees":[{"Name":"A","Age":24},{"Name":"B","Age":27}]}]
I want to know If there is an existing solution for it or I need to write my own JSON reader.
Given the sample you have shown, it is pretty easy to convert to valid Json. You need to replace the
]at the end of the first (and subsequent, but not including the last) lines with a comma, and remove the[at the beginning of all lines other than the first, eg...That is then valid Json that can be parsed by any standard parser.