none
sequence in SaveChanges() in linq to entity RRS feed

  • Question

  • Hi, what's the sequence in SaveChanges in EF?  the order in the programmer's code? 
    Is there any way to change the order?


    table1 t1 = new table1()
    table1 t2 = new table2()
    table1 t3 = new table3()

    //table2 and table3 are referencing table 1

    t1.Table2.add(t2)
    t1.Table3.add(t3)
    context.AddToTable1(t1)
     
    from the SQL server trace, the sequence is 1) add row to table1, then add a row to table 2 then add row to table3

    how can I change the insert order on table 2 and table 3?

    Thanks 
    Wednesday, February 11, 2009 5:40 PM

All replies