Code: Select all
Testdatacontext dc = new Testdatacontext();
Testchild tc = new Testchild();
tc.Text = "one";
dc.Testchilds.InsertOnSubmit(tc);
...
...
Test t = new Test();
t.Text = "numbers";
dc.Tests.InsertOnSubmit(t);
tc.Test = t;
...
dc.SubmitChanges();
Can LINQ generate insert commands in right sequence (depending on the relations), or is there any way to do this manually ?