Hi all, i've come across an issue which i can't figure out, i'll start with the line of code which is giving me problems
This is the code that looks after the links in _networkData.Code:List<Link> tempList = this._networkData.links;
Link is a class of my own construction, so i've created a strongly type list of Links stored in an instance of a class _networkData. I want to assign the list stored in _networkData to the temporary list tempList so that i can get a snapshot of it. The problem is that subsequently if i add another Link to _networkData.Links, this will also be added tp tempList even though i haven't explicitly added it to tempList and i don't want this to happen, i want tempList to stay the same.Code:private List<Link> _links = new List<Link>(); public List<Link> links { get { return _links; } set { _links = value; } }
I know my c# skills aren't brilliant and i can't find any help on google so i was hoping that someone on here could tell me what i'm doing wrong.
Thanks in anticipation.
Andy