Define a model:
public class Person
{
public string Name { get; set; }
public string Surname { get; set; }
}
and then have a collection of this model
:
List<Person> people = new List<Person>();
people.Add(new Person { Name = "John", Surname = "Smith" });
people.Add(new Person { Name = "John", Surname = "Doe" });
or:
var people = new List<Person>
{
new Person { Name = "John", Surname = "Smith" },
new Person { Name = "John", Surname = "Doe" }
};
and then you can still:
System.Console.WriteLine(people[0].Surname); //John
System.Console.WriteLine(people[1].Surname); //Doe