title: Entity Framework removes dataset in database instead of delete the link between the entities
body: <p>I have the situation that i track and trace storage situations. A storage-location can contain many stock elements. After a storage location was emptied the stock elements should still exist for statistics.</p>
  <p>This is my code:</p>
  <pre><code>                var storageElement = this.StorageElementManager.ReadStorageElement(Shelf_Level_Box_Code);
                  
                  foreach (var stockElement in storageElement.StockElements)
                  {
                      stockElement.DateOfRemovalFromStorage = DateTime.Now;
                      stockElement.StorageDuration = stockElement.DateOfRemovalFromStorage - stockElement.DateOfPlacementFromStorage;
                  }
  
                  
                  storageElement = this.StorageElementManager.UpdateStorageElement(storageElement);
  
                  
                  storageElement.StockElements = null;
  
                  //This update removes the stock elements from the database
                  storageElement = this.StorageElementManager.UpdateStorageElement(storageElement);
  </code></pre>
  <p>The last update deletes the stockelements from the database. But i only wanna destroy the relationship between the elements. How can i do this?</p>