title: Use a Generic List in a Web Service?
body: <p>I have a class of properties which is being used as part of a web service. The Class has list of another class as one of its properties:</p>
  
  <pre><code>&lt;Serializable()&gt; _
  Public Class LessonPlans
      Public Property Teacher As String
      Public Property RoomNumber As String
      Public Property Subject As String
      Public Property Students As List(Of Student)
  End Class
  
  &lt;Serializable()&gt; _
  Public Class Student
      Public Property FirstName As String
      Public Property LastName As String
  End Class
  </code></pre>
  
  <p>When I work with the LessonPlans class on the local application, I have no problem doing the following:</p>
  
  <pre><code>Dim _NewLesson As New LessonPlans
  _NewLesson.RoomNumber = "5"
  _NewLesson.Subject = "English"
  _NewLesson.Teacher = "Mr Smith"
  
  Dim _Students As New List(Of Student)
  
  Dim _NewStudent As New Student
  _NewStudent.FirstName = "James"
  _NewStudent.LastName = "Jones"
  
  _Students.Add(_NewStudent)
  
  _NewLesson.Students = _Students
  </code></pre>
  
  <p>However, when I try to add the following line on the application that consumes the web service:</p>
  
  <pre><code>_NewLesson.Students = _Students
  </code></pre>
  
  <p>I get an error:
  Error 6
  Value of type 'System.Collections.Generic.List(Of WindowsApplication1.ws_lessons.Students)' cannot be converted to '1-dimensional array of WindowsApplication1.ws_lessons.Students'.</p>