Код: Выделить всё
{
"Member": [
{
"Date": "2024-04-18T12:30:00Z",
"Information": {
"Name": "Joe",
"Reference": "AAA0866",
"Email": "test@test.com",
"Telephone": "01234 555555",
"Address": {
"Line1": "1 Street",
"Line2": "City",
"Zipcode": "012345"
},
"Employment": [
{
"EmployerName": "AAA Ltd",
"StartDate": "1980-04-01",
"EndDate": "1990-11-01"
},
{
"EmployerName": "ABC Ltd",
"StartDate": "1990-12-01",
"EndDate": "1995-10-01"
}
]
},
"PaymentInformation": [
{
"Type": "A",
"Amount": 2000,
"Increased": true
},
{
"Type": "B",
"Amount": 1000,
"Increased": false
}
],
"ExtraInfo": [
{
"Info": "ABC",
"Comments": [
"A", "B", "C"
]
},
{
"Info": "EFG",
"Comments": [
"E", "F", "G"
]
}
]
},
{
"Date": "2024-04-18T12:30:00Z",
"Information": {
"Name": "Jane",
"Reference": "CZE0866",
"Email": "test1@test.com",
"Telephone": "01234 12345",
"Address": {
"Line1": "12 Street",
"Line2": "City",
"Zipcode": "0123450"
},
"Employment": [
{
"EmployerName": "CZE Ltd",
"StartDate": "1960-04-01",
"EndDate": "1980-11-01"
}
]
},
"PaymentInformation": [
{
"Type": "A",
"Amount": 3000,
"Increased": true
}
],
"ExtraInfo": [
{
"Info": "XYZ",
"Comments": [
"X", "Y", "Z"
]
}
]
},
{
"Date": "2024-04-18T12:30:00Z",
"Information": {
"Name": "John",
"Reference": "ZYZ0866",
"Email": "test2@test.com",
"Telephone": "01234 121121",
"Address": {
"Line1": "123 Street",
"Line2": "City",
"Zipcode": "01234567"
},
"Employment": [
{
"EmployerName": "ABC Ltd",
"StartDate": "2000-04-01",
"EndDate": "2001-11-01"
}
]
},
"PaymentInformation": [
{
"Unavailable": "TBC"
}
],
"ExtraInfo": [
{
"Unavailable": "TBC"
}
]
}
]
}
Я ожидаю следующий CSV:
Код: Выделить всё
Date,Name,Reference,Email,Telephone,AddressLine1,AddressLine2,Zipcode,EmployerName,EmplymentStartDate,EmplymentStartEndDate,EmployerName1,EmplymentStartDate1,EmplymentStartEndDate1,PaymentType,PaymentAmout,PaymentIncreased,PaymentType1,PaymentAmout1,PaymentIncreased1,ExtraInfo,Comments,ExtraInfo1,Comments1
2024-04-18 12:30:00,Joe,AAA0866,test@test.com,01234 555555,1 Street,City,012345,AAA Ltd,1980-04-01,1990-11-01,ABC Ltd,1990-12-01,1996-10-01,A,2000,true,B,1000,false,ABC,A+B+C,EFG,E+F+G
2024-04-18 12:30:00,Jane,CZE0866,test1@test.com,01234 12345,12 Street,City,0123450,CZE Ltd,1960-04-01,1980-11-01,,,,A,3000,true,,,,XYZ,X+Y+Z,,
2024-04-18 12:30:00,John,ZYZ0866,test2@test.com,01234 121121,123 Street,City,01234567,ABC Ltd,2000-04-01,2001-11-01,,,,,,,,,,,,,
После использования JObject и JArray из Newtonsoft.Json.Linq для перемещения массив вокруг, я решаю проблему.
Подробнее здесь: https://stackoverflow.com/questions/783 ... ing-choetl