开发者

submit partial changes to datacontext

开发者 https://www.devze.com 2022-12-18 09:13 出处:网络
is there a way to insert an entity without using the SubmitChanges() function of the datacontext? I want to do this because I have other chan开发者_JAVA技巧ges done on my datacontext which I do not wa

is there a way to insert an entity without using the SubmitChanges() function of the datacontext? I want to do this because I have other chan开发者_JAVA技巧ges done on my datacontext which I do not want to submit yet, if I call the SubmitChanges function it will submit all changes including the ones I do not want to save yet.


Either use the new DataContext instance as it is a light-weight OR Use the InsertOnSubmit method for those entities you want to add. Than calling the SubmitChanges only update desired entities.

0

精彩评论

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