title: WCF Serialization Problem
body: <p>I'm switching code generators for my business objects. I was using SQL Metal, but in moving to  the T4 toolbox's generator, serialization seems to have stopped working, and it looks like the two are doing pretty much the same thing.</p>
  
  <p>This is the property generated by SQL Metal (which works):</p>
  
  <pre><code>[Association(Name="FK_FamilyConfiguration_Family", Storage="_FamilyConfigurations", ThisKey="FamilyID", OtherKey="FamilyID", DeleteRule="CASCADE")]
  [DataMember(Order=4, EmitDefaultValue=false)]
  public EntitySet&lt;FamilyConfiguration&gt; FamilyConfigurations
  {
      get
      {
          if ((this.serializing 
                      &amp;&amp; (this._FamilyConfigurations.HasLoadedOrAssignedValues == false)))
          {
              return null;
          }
          return this._FamilyConfigurations;
      }
      set
      {
          this._FamilyConfigurations.Assign(value);
      }
  }
  </code></pre>
  
  <p>and this is the property generated by the T4 toolbox (which does not work):</p>
  
  <pre><code>[DataMember(Order = 4, EmitDefaultValue = false)]
  [Association(Name = "Family_FamilyConfiguration", Storage = "familyConfigurations", ThisKey = "FamilyID", OtherKey = "FamilyID")]
  public EntitySet&lt;FamilyConfiguration&gt; FamilyConfigurations
  {
      get 
      {
          if (this.serializing &amp;&amp; !this.familyConfigurations.HasLoadedOrAssignedValues)
          {
              return null;
          }
  
          return this.familyConfigurations; 
      }
  
      set 
      { 
          this.familyConfigurations.Assign(value); 
      }
  }
  </code></pre>
  
  <p>As far as I can tell, they seem to generate pretty much the same thing. However, with the latter code, the object and all of its references are correctly populated (FamilyConfigurations contains a non-null entry) on the server side of a WCF call, but by the time it gets to the client, FamilyConfigurations is null.</p>
  
  <p>I'm assuming I have a serialization problem of some sort, but I don't see what the difference between the two generated properties is. Perhaps there's something else that needs to be done? The generated class of which FamilyConfigurations is a member has a DataContract tag under both generators.</p>
  
  <p>Update: FamilyConfigurations is null, it is not a collection containing null, as previously state.</p>