title: Datacontract exception. Cannot be serialized
body: <p>I have the following WCF DataContract:</p>
  
  <pre><code>[DataContract]
  public class Occupant
  {
      private string _Name;
      private string _Email;
      private string _Organization;
      private string _Badge;
  
      public Occupant(string name, string badge, string organization)
      {
          Name = name;
          Badge = badge;
          Organization = organization;
      }
  
      public Occupant(string name, string badge)
      {
          Value = name;
          Key = badge;
      }
  
      [DataMember]
      public string Key
      {
          get { return _Name; }
          set { _Name = value; }
      }
  
      [DataMember]
      public string Value
      {
          get { return _Badge; }
          set { _Badge = value; }
      }
  
      [DataMember]
      public string Name
      {
          get { return _Name; }
          set { _Name = value; }
      }
  
      [DataMember]
      public string Email
      {
          get { return _Email; }
          set { _Email = value; }
      }
  
      [DataMember]
      public string Organization
      {
          get { return _Organization; }
          set { _Organization = value; }
      }
  
      [DataMember]
      public string Badge
      {
          get { return _Badge; }
          set { _Badge = value; }
      }
  }
  </code></pre>
  
  <p>When I try to access this service via web browser (it is hosted on IIS), I am getting this error:</p>
  
  <blockquote>
    <p>System.Runtime.Serialization.InvalidDataContractException: Type 'MyNamespace.Occupant' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.  If the type is a collection, consider marking it with the CollectionDataContractAttribute.</p>
  </blockquote>
  
  <p>One of my methods is returning a <code>List</code> of type <code>Occupant</code>. Would this be causing it?</p>