L2E for insert, update, delete
- by 5YrsLaterDBA
I am using .Net3.5. Just wondering my understanding about the insert, update, delete are correct when use L2E.
For insert, we need two statements:
context.AddObject("entityName", newRow);
context.SaveChanges();
For update, we only need one statement:
context.SaveChanges();
For delete, we need two statements:
context.DeleteObject(deletedRow);
context.SaveChanges();