title: Breeze hierarchical class error "Collection navigation properties may NOT be set."
body: <p>I have installed the last version of Breeze 1.3.2 for Inheritance support.
  I have a hierarchical class with the association bidirectional:</p>
  
  <pre><code>public abstract class HClass
  {        
      public HClass()
      {
          Children = new List&lt;HClass&gt;();
      }
      [Key]
      public int Id { get; set; }
      public Nullable&lt;int&gt; ParentId { get; set; }
      public string Name { get; set; }
  
      public virtual ICollection&lt;HClass&gt; Children { get; set; }
      public virtual HClass Parent { get; set; }
  }
  </code></pre>
  
  <p>I have other classes with Inheritance:</p>
  
  <pre><code>public class AClass : HClass
  {
      public string Observation { get; set; }
  }
  
  public class BClass : HClass
  {
      public int Number { get; set; }
  }
  </code></pre>
  
  <p>The DbContext in the server:</p>
  
  <pre><code>public DbSet&lt;AClass&gt; Projects { get; set; }
  public DbSet&lt;BClass&gt; OtherProjects { get; set; }
  </code></pre>
  
  <p>The server side controller methods:</p>
  
  <pre><code>[HttpGet]
      public ICollection&lt;AClass&gt; Projects()
      {
          ICollection&lt;AClass&gt; projects = new List&lt;AClass&gt;();
          AClass pro1 = new AClass(); AClass pro2 = new AClass(); AClass pro3 = new AClass(); AClass pro4 = new AClass();
          pro1.Id = 1;
          pro1.Name = "Project 1";
          pro1.Observation = "Main";
          pro2.Id = 2;
          pro2.Name = "Project 2";
          pro2.Observation = "Main";
          pro3.Id = 3;
          pro3.Name = "Sub Project 3";
          pro3.ParentId = 1;
          pro3.Parent = pro1;
          pro4.Id = 4;
          pro4.Name = "Sub Project 4";
          pro4.ParentId = 1;
          pro4.Parent = pro1;
          pro1.Children.Add(pro3);
          pro1.Children.Add(pro4);
          projects.Add(pro1);
          projects.Add(pro2);
          return projects;
      }
  </code></pre>
  
  <p><strong>The each item in "projects" had set "Parent" and "Children" items and method Projects return the hierarchical composition.</strong> </p>
  
  <p>But I have the next error <code>Collection navigation properties may NOT be set.</code>. When I was querying:</p>
  
  <pre><code>return entityQuery.from('Projects')
              .using(manager).execute()
              .then(success)
              .fail(queryFailed);
  </code></pre>
  
  <p>The error is in <code>breeze.debug.js</code>:</p>
  
  <pre><code>function updateRelatedEntity(relatedEntity, targetEntity, navigationProperty) {
      if (!relatedEntity) return;
      var propName = navigationProperty.name;
      var currentRelatedEntity = targetEntity.getProperty(propName);
      // check if the related entity is already hooked up
      if (currentRelatedEntity !== relatedEntity) {
          // if not hook up both directions.
          targetEntity.setProperty(propName, relatedEntity); //Error here
          var inverseProperty = navigationProperty.inverse;
          if (!inverseProperty) return;
          if (inverseProperty.isScalar) {
              relatedEntity.setProperty(inverseProperty.name, targetEntity);
          } else {
              var collection = relatedEntity.getProperty(inverseProperty.name);
              collection.push(targetEntity);
          }
      }
  }
  </code></pre>
  
  <p>When I use <code>HClass</code>, breeze work perfectly, but the error appears when I use <code>AClass</code> or <code>BClass</code> with Inheritance.</p>
  
  <p>I have updated to Breeze 1.3.3 but error persists</p>
  
  <p>Please, help me with this error, any suggestion will be welcome.</p>