同一事务中的Multiblle DataContext [英] Multiblle DataContext in the Same Transaction

查看:86
本文介绍了同一事务中的Multiblle DataContext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我有一个案例,我需要调用多个方法,每个方法都会调用不同的DataContext,我需要确保所有这些方法都在同一个事务处理下运行,任何人都知道如何做到这一点或者如果LINQ已构建i支持
感谢

Hi All
i Have a Case where I need to call multible Methods each will call defferent DataContext and I need to ensure that all these method will run under the Same transaction dose any one have an idea how to do this  or if LINQ have built i Support
Thanks

推荐答案

将它们包装在TransactionScope中:

http://msdn.microsoft .com / zh-CN / library / ms172152.aspx

问候

Wrap them in a TransactionScope:

http://msdn.microsoft.com/en-us/library/ms172152.aspx

Regards

Joe


这篇关于同一事务中的Multiblle DataContext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆