I have a web API response like below and I need to move all objects into a single array in C# ASP.NET
[
[
{
"id":23,
"name":"John",
"email":"[email protected]",
"appointment_date":"tomorrow",
"appointment_category":3,
"time":"morning"
},
{
"id":35,
"name":"John",
"email":"[email protected]",
"appointment_date":"tomorrow",
"appointment_category":4,
"time":"afternoon"
}
],
[
{
"id":17,
"name":"Alex",
"email":"Alex @domain.com",
"appointment_date":"tomorrow",
"appointment_category":3,
"time":"morning"
}
],
[
{
"id":22,
"name":"Bob",
"email":"[email protected]",
"appointment_date":"tomorrow",
"appointment_category":5,
"time":"morning"
}
]
]
I want to move all objects into single array. Like below
[
{
"id":23,
"name":"John",
"email":"[email protected]",
"appointment_date":"tomorrow",
"appointment_category":3,
"time":"morning"
},
{
"id":17,
"name":"John",
"email":"[email protected]",
"appointment_date":"tomorrow",
"appointment_category":3,
"time":"morning"
},
{
"id":17,
"name":"John",
"email":"[email protected]",
"appointment_date":"tomorrow",
"appointment_category":3,
"time":"morning"
}
]
Please help me Thank u
result.SelectMany(x => x).ToArray()