title: wcf newbie question: arrays as properties
body: <p>I have DataContract class which has property of type <code>List&lt;AnotherObject&gt;</code>.  AnotherObject is also marked with DataContract.  For some reason this property comes from wcf service as null, althought I fill it at the server.  Is that by design? </p>
  
  <p>Here you go.  Class definitions:</p>
  
  <pre><code>[DataContract]
      public class UserInfo
      {
          [DataMember]
          public decimal UserID
          {
              get;
              protected internal set;
          }
  
          [DataMember]
          public string UserName
          {
              get;
              protected internal set;
          }
  
          [DataMember]
          public string Pswd
          {
              get;
              protected internal set;
          }       
  
          [DataMember]
          public List&lt;decimal&gt; RoleID
          {
              get;
              protected internal set;
          }
  
          List&lt;UserRole&gt; userRolesTable = new List&lt;UserRole&gt;();
          [DataMember]
          public List&lt;UserRole&gt; UserRoles
          {
              get
              {
                  return userRolesTable;
              }
              protected internal set { }
          }       
      }
  
  
  
  [DataContract]
      public class UserRole
      {
          [DataMember]
          public decimal ROLEID { get; internal set; }
  
          [DataMember]
          public string ROLE_CODE { get; internal set; }
  
          [DataMember]
          public string ROLE_DESCRIPTION { get; internal set; }
  
          [DataMember]
          public decimal FORMID { get; internal set; }
  
          [DataMember]
          public string FORMCODE { get; internal set; }
  
          [DataMember]
          public string FORMNAME { get; internal set; }
      }
  </code></pre>
  
  <p>UserRoles property comes as null.</p>