Click here to Skip to main content
15,903,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
var contentItem = new List<Dictionary<string, object>>();

                foreach (var dictionary in (List<Dictionary<string, object>>)reciptDictionary["Content"])
                {
                    contentItem.Add(dictionary);
                }



Like this Im creating a new list (contentItem) using existing list(reciptDictionary).
But in here when I change values in contentItem it also change values in reciptDictionary. I dont want that. I want original list to remain same.

Can someone please tell me how to do this. Thanks
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900