title: Adding related master/child entities (one to many) in breeze
body: <p>I have a master file for a widget and there can be many versions of that widget that share the same widgetmaster. So there are widgetMasters and widgetVersions tables on the db.</p>
  
  <p>widgetMaster ID is an identity integer field and has an icollection of widgetversions set.</p>
  
  <p>Widgetversion has a foreign key pointing to the widgetMaster ID it belongs to.</p>
  
  <p>I have a "create new widget" form on my site. This is loaded after a button is pressed and it uses "createEntity" to create blank entities for widgetMaster and widgetVersion. The idea is that the parent "widgetMaster" is created at the same time the version "001" is created. The master just contains the description and a few category fields. The version contains the specific fields relating to this version of the widget and there may be dozens of versions eventually.</p>
  
  <p>The user fills in all the fields and presses "save".</p>
  
  <p>At this point I validate the form fields and, if all is ok, move on to saving the entity via "datacontext.saveChanges()" This is done in the viewmodel for my "create new" form view.</p>
  
  <p>This works fine when creating the widgetMaster, but I need to have more control of this process I think...  I need to set the foreign key on the widgetVersion entity AFTER The id is created by "savechanges" but BEFORE it attempts to save the widgetVersion entity.</p>
  
  <p>As "datacontext.saveChanges()" appears to be a one-stop shop I'm entirely baffled as to how I can save the widgetVersion entity with the newly-created ID from the widgetmaster I just saved.</p>