title: Protobuf-Net Empty List
body: <p>Came across protobuf-net, awesome! I have a question regarding serialization of empty lists.</p>
  
  <p>I start by declaring the object I want to serialize:</p>
  
  <pre><code>[ProtoContract]
  class TestClass
  {
      [ProtoMember(1)]
      List&lt;int&gt; _listOfInts = new List&lt;int&gt;();
  
      public TestClass() { }
  
      public List&lt;int&gt; ListOfInts
      {
          get { return _listOfInts; }
          set { _listOfInts = value; }
      }
  }
  </code></pre>
  
  <p>If _listOfInts is empty (but not null) when I deserialse this object is will always be null. This makes sense looking at the protobuf convention and I currently work around this by adding the following method:</p>
  
  <pre><code>[ProtoAfterDeserialization]
  private void OnDeserialize()
  {
      if (_listOfInts == null)
          _listOfInts = new List&lt;int&gt;();
  }
  </code></pre>
  
  <p>My question is whether I can achieve this same functionality in a more concise fashion, possibly with an additional attirbute which will initialise null/empty objects as empty instead of null?</p>