I have an array of json objects like this:
[{
    "Time-VitalsTime": "2019-06-22T01:01:00",
    "TimeToEstimate-VitalsTime": 10,
    "TimeToEstimate-1unit": 5,
    "TimeToEstimate-2units": 9,
    "TimeToEstimate-3units": 21,
    "TimeToEstimate-1week": 13,
    "TimeToEstimate-2weeks": 16,
    "TimeToEstimate-3weeks": 20
}, {
    "Time-VitalsTime": "2019-06-22T01:02:00",
    "TimeToEstimate-VitalsTime": 8,
    "TimeToEstimate-1unit": 10,
    "TimeToEstimate-2units": 5,
    "TimeToEstimate-3units": 9,
    "TimeToEstimate-1week": 18,
    "TimeToEstimate-2weeks": 15,
    "TimeToEstimate-3weeks": 32
}, {
    "Time-VitalsTime": "2019-06-22T01:03:00",
    "TimeToEstimate-VitalsTime": 10,
    "TimeToEstimate-1unit": 8,
    "TimeToEstimate-2units": 10,
    "TimeToEstimate-3units": 5,
    "TimeToEstimate-1week": 15,
    "TimeToEstimate-2weeks": 14,
    "TimeToEstimate-3weeks": 16
}, 
And I need to get it into this shape (according to the api documentation):
{
"data":
    [
        <model-specific-data-structure>
    ]
}
The code used to generate the string above is:
public string ConvertCsvFileToJsonObject(string path)
{
    var csv = new List<string[]>();
    var lines = File.ReadAllLines(path);
    foreach (string line in lines)
        csv.Add(line.Split(','));
    var properties = lines[0].Split(',');
    var listObjResult = new List<Dictionary<string, string>>();
    for (int i = 1; i < lines.Length; i++)
    {
        var objResult = new Dictionary<string, string>();
        for (int j = 0; j < properties.Length; j++)
            objResult.Add(properties[j], csv[i][j]);
        listObjResult.Add(objResult);
    }
    var newlistObjResult = new List<Dictionary<dynamic,dynamic>>();
    var count = 0;
    foreach (var dictionary in listObjResult)
    {
        Console.WriteLine($"Dictionary I am currently on: {count}");
        var newDict = new Dictionary<dynamic, dynamic>();
        foreach (var item in dictionary)
        {
            DateTime dateTime;
            if (DateTime.TryParse(item.Value, out dateTime))
            {
                newDict.Add(item.Key, dateTime);
                continue;
            }
            else
            {
                try
                {
                    var asInt = Convert.ToInt32(item.Value);
                    newDict.Add(item.Key, asInt);
                }
                catch (Exception e)
                {
                    var ex = e.Message;
                }
            }
        }
        newlistObjResult.Add(newDict);
        count += 1;
    }           
    var result2 = JsonConvert.SerializeObject(newlistObjResult);
    return result2;
}
Then I'm using this:
 request.Content = new StringContent(JsonConvert.SerializeObject(stringgeneratedabove));
to serialize it to send to a REST api. The error I am getting back from the call is: "{\"error\": \"string indices must be integers\"}"
A friend said that I need to pass the array in a property named "data". After doing a fair amount of searching online, I do not know where to start. I tried doing something like this:
[DataContract]
public class CsvDataClass
{
    [DataMember]
    public List<Dictionary<object, object>> CsvData { get; set; }
    [DataMember]
    public Dictionary<object, object>[] Data
    {
        get { return CsvData.ToArray(); }
    }
}
based on what a friend said, but couldn't get it implemented. I've searched for "changing the shape of json c#" or "passing json array into a property", and have also read general documentation about json objects, but nothing has clicked yet.
 
    