I have two tables in the dbml, Table1 and Table2. Table1 has a Table1ID as primary key and Table2 has Table1ID as foreign key.
I have an instance of Table1 called table1,
Table1 table1 = new Table1();
table1.Table2 = new System.Data.Linq.EntitySet<Table2>();
table1.Table2.AddRange(table2List); //table2List is a List<Table2>
then I create another instance of Table1 called anotherTable1,
Table1 anotherTable1 = Table1(); // clone
anotherTable1.Table2 = null;
At this point, my intention is to have table1 containing a list of Table2 and anotherTable1 containing 0 Table2. However, both table1.Table2 and anotherTable1.Table2 become 0 count.
Why is that? How to make it the way I wanted?
View Complete Post