简体   繁体   中英

L2E for insert, update, delete

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();

When performing an update you first need to update a property of an entity of course.

Your code for insert and delete is correct.

But what is your question actually?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM