Created
January 17, 2020 02:27
-
-
Save townivan/a4381ccbcc7f534b40a3e3e63fe3ffeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
// test at https://dotnetfiddle.net/ | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine("List practice"); | |
List<Person> peeps = new List<Person>(); | |
peeps.Add(new Person {FirstName = "Bill", LastName = "Jones" }); | |
peeps.Add(new Person {FirstName = "Cindy", LastName = "Smith" }); | |
foreach(var peep in peeps) | |
{ | |
Console.WriteLine($"The person is {peep.FirstName} {peep.LastName}"); | |
} | |
} | |
} | |
public class Person | |
{ | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment