0

I am using WCF Service which performs database transaction. I am finding 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?

Ulhas Tuscano
  • 5,502
  • 14
  • 58
  • 89
  • LINQ2SQL and EF both support TransactionScopes - see here http://stackoverflow.com/questions/542525/transactionscope-vs-transaction-in-linq-to-sql – StuartLC Jun 06 '11 at 10:15

1 Answers1