I have two ICollection
lists fullList
and displayList
.
private void method()
{
if(condition != null) {
displayList.Clear();
if(fullList.Count() > 0)
{
displayList.ClearAndAddRange(
fullList.Where(x=>x.conditionID == condition.conditionID));
}
}
}
The problem I'm currently facing is whenever I update some value in displayList
, fullList
gets also updated . Is this expected behaviour?
What is the best way to modify it so that they won´t share references in between?