I have code as follows:
var feeCTC = new FeeGroup(); feeCTC = feeGroup;
var feeWYS = new FeeGroup(); feeWYS = feeGroup;
feeCTC.FeeValue = 231;
firstList.Add(feeCTC);
feeWYS.FeeValue = 1269;
secondList.Add(feeWYS);
The problem I'm coming across is that once I get to the second calcuation that sets feeWYS.FeeValue
, feeCTC.FeeValue
is also updated to the same number (and so is its value in firstList
), which leads me to believe that they are references to the same address. How do I clone feeGroup
so that I can manipulate its values (and without using ICloneable interface)?