开发者

How to handle transaction in WCF Service with LINQ

开发者 https://www.devze.com 2023-03-10 21:57 出处:网络
I am using WCF Service which performs database transaction. I am findin开发者_Go百科g a way to rollback when any operation fails.

I am using WCF Service which performs database transaction. I am findin开发者_Go百科g a way to rollback when any operation fails.

  public void UpdateFirstTable()
            {
                //Linq query to update table1
            }

        public void UpdateSecondTable()
        {
            //Linq query to update table2
        }

if an exception occus while performing any operation in UpdateFirstTable() & UpdateSecondTable() changes made should be rolled back. How to achieve this?


http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx#Y1900

0

精彩评论

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