title: Table splitting – how do we insert a new row?
body: <p>I'm using table splitting to map entities <code>Entity1</code> and <code>Entity2</code> to a DB table <code>MyTable</code>. </p>
  
  <p>Is there a way to insert a new row into <code>MyTable</code> by adding an instance of  <code>Entity1</code> (or <code>Entity2</code>) to the context and let EF construct the necessary <code>Insert</code> command. I tried the following, but it throws an exception:</p>
  
  <pre><code>        Entity2 entity = new Entity2();
          context.Entity2.AddObject(entity);
  
          context.SaveChanges();// UpdateException: Invalid data encountered. A 
                                // required relationship is missing
  </code></pre>
  
  <p>thank you</p>