Fairly new to c# and a bit confused...
I have a class that retrieves 2 values and places them inside an array, I then wish to add the array to a list.
The array acts as an item for purchase and the list will act as the basket.
public void Add(int Id , int Quantity )
{
int[] buying = new int[] { Id, Quantity };
//AddTo(buying);
List<int[]> arrayList = new List<int[]>();
arrayList.Add(buying);
}
I'm just stuck on how to add to the list without creating a new instance of a list and there fore loosing any items already added?
Thanks for any help :)