locked
Batch behavior in STE RRS feed

  • Question

  • Hi,

    How do I change batch behavior in STE? Example

    If I delete parent object then all its child object should be deleted in one go. In RC 2010 STE generate delete SQL statement for each child object

    current STE behavior

    delete from child where parentId = 1 and childId = 1

    delete from child where parentId = 1 and childId = 2

    delete from parent where parentId = 1

    I expect

    delete from child where parentId = 1

    delete from parent where parentId = 1

    Thanks,

    Ashraf

    Tuesday, March 30, 2010 6:14 PM

Answers

  • Unfortunately Entity Framework does not support batch commands (i.e. update/delete commands that affect multiple rows). However there are some attempts to extend LINQ to SQL with batch update functionality, which could probably be adapted to EF. The quickest, safest way to work around this issue is to use stored procedures or ObjectContext.ExecuteStoreCommand.
    • Marked as answer by Ashraf TM Thursday, April 1, 2010 10:20 PM
    Tuesday, March 30, 2010 10:19 PM