Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm using Entity Framework 4.1
When i update entity (has child table with 50 data), it will be long time
Cause of EF will send 50 delete query and 50 insert query to child table
the example code is below :

C#
var existingEntity = (from E in Entities.Include("GoodReceiptItems")
                                  where E.ReceiptId == entity.ReceiptId
                                  select E).FirstOrDefault();

            // Update Good Receipt Repository
            existingEntity.Merge(entity);

            Entities.ApplyCurrentValues(existingEntity);


in code above we can see the entity has "GoodReceiptItems" table (50 data)

i need any suggestion for making this matter has good time response or better performance
do you have any suggestion?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900