Krivahn Doss

Krivahn Doss

  • NA
  • 33
  • 0

Custom types

Dec 24 2009 3:00 AM

I have a generic list of custome types. list<MyType> where MyType is a class so that makes
it a reference type. I have the following
List<MyType> myType1 = new List<MyType>();
List<MyType> myType2 = new List<MyType>();
myType2 = myType1;
How do I assign myType2 to point to a different part in memory or to a value type.
I also tried the following but when myType1 list changes the changes occure in myList2
as well.
List<MyType> myType2 = new List<Mytype>(myType1);

Answers (1)