title: Error on seed self-referencing table MVC 4
body: <p>I'm following <a href="http://www.mikesdotnetting.com/article/255/entity-framework-recipe-hierarchical-data-management" rel="nofollow">this tutorial</a> to create a self-referencing table. I have this in the seed method:</p>
  
  <pre><code>            var menuItems = new List&lt;Subcomponent&gt;{
      new Subcomponent{TipoSub = "Testes", NomeSub = "Testes", NotaMinimaSub = 9, PesoSub = 10, Ordem = 1},
      new Subcomponent{TipoSub = "Testes", NomeSub = "Testes", NotaMinimaSub = 9, PesoSub = 10, Ordem = 2},
      new Subcomponent{TipoSub = "Testes", NomeSub = "Testes", NotaMinimaSub = 9, PesoSub = 10, Ordem = 3},
      new Subcomponent{TipoSub = "Testes", NomeSub = "Testes", NotaMinimaSub = 9, PesoSub = 10, Ordem = 4},
      new Subcomponent{TipoSub = "Testes", NomeSub = "Testes", NotaMinimaSub = 9, PesoSub = 10, Ordem = 5},
      new Subcomponent{TipoSub = "Testes", NomeSub = "Testes", NotaMinimaSub = 9, PesoSub = 10, Ordem = 1, ParentSubcomponentId = 1},
      new Subcomponent{TipoSub = "Testes", NomeSub = "Testes", NotaMinimaSub = 9, PesoSub = 10, Ordem = 2, ParentSubcomponentId = 1},
      new Subcomponent{TipoSub = "Testes", NomeSub = "Testes", NotaMinimaSub = 9, PesoSub = 10, Ordem = 3, ParentSubcomponentId = 1},
      new Subcomponent{TipoSub = "Testes", NomeSub = "Testes", NotaMinimaSub = 9, PesoSub = 10, Ordem = 1, ParentSubcomponentId = 7},
      new Subcomponent{TipoSub = "Testes", NomeSub = "Testes", NotaMinimaSub = 9, PesoSub = 10, Ordem = 2, ParentSubcomponentId = 7},
      new Subcomponent{TipoSub = "Testes", NomeSub = "Testes", NotaMinimaSub = 9, PesoSub = 10, Ordem = 3, ParentSubcomponentId = 7}
  };
              menu.SubcomponentsComp = menuItems;
              context.Components.AddOrUpdate(m =&gt; m.SubcomponentsComp, menu);
              context.SaveChanges();
          }
  </code></pre>
  
  <p>just like in the tutorial. But it gives this error when i try to update the database:</p>
  
  <blockquote>
    <p>Unable to create a constant value of type 'SGP.Models.Subcomponent'.
    Only primitive types or enumeration types are supported in this
    context.</p>
  </blockquote>
  
  <p>Anyone has an idea why is this error appearing? Thanks</p>