I am learning how to use Lists as part of C# generic collections. The code listed below is a simple class called Person with FirstName, LastName and Age as attributes for each employee in the Person Class.
After creating the class comes the List which is of type Person with an object called employees. Then I add two employees to the list.
All goes well except when I run the code I don't get the expected particulars of the second employee, instead I get "ConsoleApplication2.Person". I want to know what I am doing wrong. Thanks.
namespace ConsoleApplication2
{
class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
public Person(string FirstName, string LastName, int Age)
{
this.FirstName = FirstName;
this.LastName = LastName;
this.Age = Age;
}