I have below code in my Silverlight application and I want to get the query statement [Insert into Customer Values ("New customer name")] from the WCF class insert method that I created, as show below from the Linq InsertOnSubmit(). Anyway way I can achieve that? I understand that I can use the DataContext.Log = console.Out to display the statement. But what I want is to get the statement as string and then insert into another table to keep as a log. This action will be apply to update and delete as well. Any advices? Thanks in advance.
Customer _obj = new db.Customer(). db = new LinqDataContext(); _obj.name = "New customer name"; db.Customers.InsertOnSubmit(_obj); db.Customers.Context.SubmitChanges();