Q:

JSON JObject Detect Multiple Array Objects

Is there a way to pull out all arrays from a Json Response, where i dont know the name of each array in the response. 
I basically want to detect the number of array objects in the JSON, and then access each one individually. 
I'm doing this dynamically, so one response may only contain the "employees" array, the next response may include both. The structure of both array's will always remain the same. 
{
    "employees": [
        {
            "firstName": "John",
            "lastName": "Doe"
        },
        {
            "firstName": "Anna",
            "lastName": "Smith"
        },
        {
            "firstName": "Peter",
            "lastName": "Jones"
        }
    ],
    "employers": [
        {
            "firstName": "John",
            "lastName": "Doe"
        },
        {
            "firstName": "Anna",
            "lastName": "Smith"
        },
        {
            "firstName": "Peter",
            "lastName": "Jones"
        }
    ]
}

A:

First of all, according to your statement, as the structure of both arrays will always remain the same, we may define the structure as a List<FullName>; given that,
public class FullName
{
    public string firstName { get; set; }
    public string lastName { get; set; }
}

Second, as you don't know the name of each array in the response in advance, a data structure like Dictionary may be appointed.
Fyki, I am using Json.Net here. So please do not forget to add the reference in advance.
Please see the code below:
// 'json' is in enquoted string format 
string  json = "{\"employees\": [{\"firstName\": \"John\",\"lastName\": \"Doe\"},{\"firstName\": \"Anna\",\"lastName\": \"Smith\"},{\"firstName\": \"Peter\",\"lastName\": \"Jones\"}],\"employers\": [{\"firstName\": \"John\",\"lastName\": \"Doe\"},{\"firstName\": \"Anna\",\"lastName\": \"Smith\"},{\"firstName\": \"Peter\",\"lastName\": \"Jones\"}]}";

var dictCategoryList = JsonConvert.DeserializeObject<Dictionary<string, List<FullName>>>(json);

where dictCategoryList is of type Dictionary<string, List<FullName>>.
In this way, you just have to use dictCategoryList.Count to detect the number of array objects in the JSON, and then access each one individually like below:
foreach (var category in dictCategoryList)
{
    foreach (var item in category.Value)
    {
        Console.WriteLine(string.Format("First Name: {0}, Last Name: {1}", item.firstName, item.lastName));
    }
}

