This code works correctely to make a web service call
int numberOfGuests = Convert.ToInt32(search.Guest);
var list = new List<Guest>();
Guest adult = new Guest();
adult.Id = 1;
adult.Title = "Mr";
adult.Firstname = "Test";
adult.Surname = "Test";
list.Add(adult);
Guest adult2 = new Guest();
adult2.Id = 2;
adult2.Title = "Mr";
adult2.Firstname = "Test";
adult2.Surname = "Test";
list.Add(adult2);
Guest[] adults = list.ToArray();
How do I build the list dynamically using the numberofguests variable to create the list. The output has to match the output shown exactaly else the web service call fails, so adult.id = 1, adult2.id = 2, adult3.id = 3 etc...