开发者

How to call Membership and Roles methods inside transaction?

I have a method which calls Membership.UpdateUser开发者_如何学编程() as well as some Roles methods along with some custom inserts, deletes of my own. Is it possible to do all this in a transaction? I don't see any way to associate a transaction with the Membership or Roles providers. To clarify, I would like all operations to happen within the same transaction.


Place your updates within a TransactionScope scope:

using (TransactionScope trans = new TransactionScope([option]))
{
    Membership.Provider.UpdateUser(...);
    Membership.Provider.UpdateUser(...);
    trans.Complete();
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜