title: EF4 ASP.NET - Managing Entity Edits between HTTP Posts and Rollback
body: <p>I am struggling with the following use-case:</p>
  
  <p>User amends an existing order. The order is complex - lots of related 'entities' (addresses, post options, suppliers, makes, models, various items etc). Across multiple http posts.</p>
  
  <p>User wants to discard the changes.</p>
  
  <p>--</p>
  
  <p>I have an order entity and as the user is editing this I am making various changes to the entity associations e.g changing order.address, order.items.add(item)...</p>
  
  <p>In a single post this is fine, but across posts I don't know how best store state. If I store the entities then I cannot save the changes as they are across different data contexts. I have read that it is bad practice to store the data context in the session state i.e. long-lived context. I can't save changes after each edit/post because I cannot roll-back (?). I really would like to work with the entities during the editing process rather than one big save at the end (taking UI settings and applying these in one chunk).</p>
  
  <p>This must be a pretty common problem - it's driving me mad. Any help really appreciated.</p>
  
  <p>Cheers!</p>