I'm relatively new to C# and I'm looking to replicate this following JSON expression:
{"itemData":[{"pile":"club","id":"100997087277"}]}
At present I have the following methods:
public class MoveItemValues
{
public string pile;
public Int64 id;
}
public class MoveItemRequestValues
{
public MoveItemValues itemData;
}
internal string moveItem(Int64 itemId, string pile)
{
string moveItemResponse;
MoveItemRequestValues bodyContent = new MoveItemRequestValues();
bodyContent.itemData = new MoveItemValues();
bodyContent.itemData.pile = pile;
bodyContent.itemData.id = itemId;
string jsonContent = JsonConvert.SerializeObject(bodyContent);
byte[] byteArray = Encoding.UTF8.GetBytes(jsonContent);
Console.WriteLine(jsonContent);
}
This produces:
"{"itemData":{"pile":"trade","id":100997087277}}"
But as you can see the square brackets are missing.
How would I go about finishing off achieving this?

List<MoveItemValues>.longinstead ofInt64.