开发者

L2E for insert, update, delete

开发者 https://www.devze.com 2022-12-26 15:35 出处:网络
I am using .Net3.5. Just wondering my understanding about the insert, update, delete are correct when use L2E.

I am using .Net3.5. Just wondering my understanding about the insert, update, delete are correct when use L2E.

For insert, 开发者_JAVA百科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?

0

精彩评论

暂无评论...
验证码 换一张
取 消