title: Adding List - two different methods
body: <p>I have a list of ClassRooms and then I get a list of students inside that classroom. Here in this method, I create a list of ClassRoom first. then I get the list of students in that classroom. Now when I am trying to add the list of students to the first list. I get this error.</p>
  
  <blockquote>
    <p>The best overload method match for List... has invalid arguments</p>
  </blockquote>
  
  <pre><code>public static List&lt;MyList&gt; getRecords()
  {
      int id = 10;
      int id2 = 20;
      List&lt;MyList&gt; ClassRooms = GetClassRooms(id);
      foreach(MyList Students in ClassRooms)
      {
          List&lt;MyList&gt; studentProfile = GetStudentProfile(id, Students.ID);
          foreach(MyList studentDetail in studentProfile) ClassRooms.Add(studentDetail);
      }   
      return ClassRooms;
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>UPDATE - </p>
  
  <pre><code>public class MyList
  {
      public int ID;
      public string Class Number;
      public bool Active;
      public int StudentID;
      public string FirstName;
      public string LastName;
      public int TotalStudents;
  }
  </code></pre>