title: Trying to learn c# lists and how to access them, also from other classes
body: <p>I am new to C# and learning about List in OOP model. Im having an issue accessing a List, well when I run in the command prompt its just blank.</p>
  
  <p>In the search class I am basically getting a List of all person's (I think I am)
  and searching for the Adults(over 20 years old).
  From the Main I am trying to print out the List of Adults.
  Its hard finding an answer for this question.</p>
  
  <p>So this is the code: </p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          Search s = new Search();
          List&lt;Person&gt; GameOfThrones = new List&lt;Person&gt;();
  
          GameOfThrones.Add(new Person("Rob Stark", 20, Gender.Male));
          GameOfThrones.Add(new Person("Sansa Stark", 16, Gender.Female));
          GameOfThrones.Add(new Person("The Mountain", 30, Gender.Transgender));
          GameOfThrones.Add(new Person("Mellisandra", 100, Gender.Female));
          GameOfThrones.Add(new Person("Ramsey Bolton", 20, Gender.Male));
  
  
  
          foreach(Person abc in s.getAdults())
          {
              Console.WriteLine(abc.ToString());
          }
  
  
          Console.ReadKey();
      }
  
  }
  
  class Search
  {
      private List&lt;Person&gt; allPersons = new List&lt;Person&gt;();
  
      public List&lt;Person&gt; Apl
      {
          get { return allPersons; }
      }
      public List&lt;Person&gt; getAdults()
      {
          List&lt;Person&gt; Adults = new List&lt;Person&gt;();
          foreach (Person test in allPersons)
          {
  
              if (test.Age &gt; 20)
              {
                  Adults.Add(test);
                  //Console.WriteLine(test.ToString() + "\n");
              }
          }
          return Adults;
      }
  
      public List&lt;Person&gt; allMales()
      {
          List&lt;Person&gt; males = new List&lt;Person&gt;();
          foreach(Person per in allPersons)
          {
              if(per.GenderType == Gender.Male)
              {
                  males.Add(per);
              }
          }
          return males;
      }
   }
  
  class Person
  {
      public Person(string name, int age, Gender gen)
      {
          this.Name = name;
          this.Age = age;
          this.GenderType = gen;
      }
      public string Name { get; set; }
      public int Age { get; set; }
      public Gender GenderType { get; set; }
  
      public override string ToString()
      {
          return "Name: " + Name + "\nAge: " + Age + "\nGender: " + GenderType;
      }
  }
  </code></pre>