本文介绍了为什么没有“UpdateOnSubmit”方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过"UpdateOnSubmit"排队一系列插入内容。在"SubmitChanges"上进行交易的方法,如果有任何失败,则使用事务回滚。但是,我对如何管理更新感到困惑,因为似乎没有一个平等的"UpdateOnSubmit"。这可以包含在SubmitChanges集合中。

I can queue up a series of Inserts via the "UpdateOnSubmit" method that are transacted on "SubmitChanges", with a transaction rollback if any fail. However, I am confused on how updates are managed as there does not seem to be an equilivent "UpdateOnSubmit" that can be included in the SubmitChanges collection.

我似乎在这里缺少一些基本的东西。有人可以解释我会怎样做:

I seem to be missing something basic here. Can someone explain how I would do something like:

dctx.customer.InsertOnSubmit(cust);
dctx.vehicle.UpdateOnSubmit(veh);
dctx.stock.InserOnSubmit (股票);

dctx.customer.InsertOnSubmit(cust);
dctx.vehicle.UpdateOnSubmit(veh);
dctx.stock.InserOnSubmit(stock);

dctx.SubmitChanges(ConflictMode.ContinueOnConflict);

dctx.SubmitChanges(ConflictMode.ContinueOnConflict);

推荐答案


这篇关于为什么没有“UpdateOnSubmit”方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 19:32