title: Assign List<T> to another List<T> by value not reference
body: <p>Ok so I have List list1  that I pulled from db and I want to temporary save this to List list2, perform some operation on my list1 save it to db and then play with list2 and save it to db. The problem is that because is is passed by reference once I change some fields in list1, list2 is already updated. </p>
  
  <p>Is there any way to pass whole list as a value not reference?</p>
  
  <p>Here is some code to make it clearer :</p>
  
  <pre><code>var CurrentMenuItems = dbContext.menu_items.Where(m =&gt; m.optgroup == currentGroup &amp;&amp; m.day_id == menuItem.day_id).ToList();
  
             List&lt;menu_item&gt; MenuItemsToBeEditedAfterSubmitChanges = CurrentMenuItems;// we need to store this by value, so we can update it later
  
  
              byte ItemIncrease = 50; // To store temp value so we can avoid duplicate entry for item number 
  
              foreach (var item in CurrentMenuItems)
              {
                  item.optgroup = nextGroup;
                  item.item = ItemIncrease;
  
                  ItemIncrease++; 
              }
  
              var menuItemsToBeReplaced = dbContext.menu_items.Where(m =&gt; m.optgroup == nextGroup &amp;&amp; m.day_id == menuItem.day_id).ToList(); // we want to move all items within this group
  
              dbContext.SubmitChanges();
  
              foreach (var item in menuItemsToBeReplaced)
              {
                  item.optgroup = currentGroup;
  
                  item.item = (byte)(item.item - 1);
  
              }
  
              dbContext.SubmitChanges();
  
              // After first save, update the first group of menu items
  
              foreach (var item in MenuItemsToBeEditedAfterSubmitChanges)
              {
  
                  item.optgroup = nextGroup;
                  item.item = (byte)(item.item + 1);
  
              }
  
              dbContext.SubmitChanges();
  </code></pre>