title: Why can't I insert record with foreign key in a single server request?
body: <p>I'm tryring to do a simple insert with foreign key, but it seems that I need to use <code>db.SaveChanges()</code> for every record insert. How can I manage to use only one <code>db.SaveChanges()</code> at the end of this program?</p>
  
  <pre><code>public static void Test()
  {
      using (var entities = new DBEntities())
      {
          var sale =
              new SalesFeed
              {
                  SaleName = "Stuff...",
              };
          entities.AddToSalesFeedSet(sale);
  
          var phone =
              new CustomerPhone
              {
                  CreationDate = DateTime.UtcNow,
                  sales_feeds = sale
              };
          entities.AddToCustomerPhoneSet(phone);
  
          entities.SaveChanges();
      }
  }
  </code></pre>
  
  <p>After running the above code I get this exception:</p>
  
  <p><em>System.Data.UpdateException: An error occurred while updating the entries. See the InnerException for details. The specified value is not an instance of a valid constant type
  Parameter name: value.</em></p>
  
  <p><strong>EDIT:</strong> Changed example code and added returned exception.</p>