Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is there an equilivant to GetCommand in LINQ to SharePoint? I know about ctx.Log, but I'm looking for something to retrieve the CAML from a LINQ statement without executing it.

share|improve this question

2 Answers 2

Yes, as described in How to: View CAML Generated by LINQ to SharePoint, you just need to access the DataContext.Log property.

share|improve this answer

If you want to view your CAML query without deploying and executing the code, you can use LINQPAD with the SharePoint 2010 Data Context Driver (from Codeplex). If you scroll down on the linked documentation page, you see that the CAML is generated under the SQL result tab.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.