Writing a Linq to SharePoint query equivalent to SPSiteDataQuery
-
Tuesday, May 15, 2012 6:59 AM
hi,
I have a requirement where i have to write a Linq to SharePoint query, which is equivalent to SPSiteDataQuery in sharepoint.. can i get some help in this...
Thanks, Neela Krishna
All Replies
-
Tuesday, May 15, 2012 7:18 AM
SPSiteDataQuery is a separate method to query and access SharePoint data till now linq do not support it directly refer microsoft documentation
however you can build your own parser that convert you linq query and generate the correponding query like refer the blog.
- Proposed As Answer by Dmitry KaloshinMicrosoft Community Contributor Tuesday, May 15, 2012 9:50 AM
- Marked As Answer by GuYumingMicrosoft Contingent Staff, Moderator Wednesday, May 16, 2012 8:06 AM
-
Tuesday, May 15, 2012 12:33 PMI like the solution mentioned by Ishaan, but it is as said: it translates Linq to CAML but doesn't convert it to entities. As an alternative, what you can do is this: since SPSiteDataQuery knows how to aggregate data across multiple sites, you need to get the same in Linq/SPMetal: http://msdn.microsoft.com/en-us/library/ff798478.aspx explains how.
Kind regards,
Margriet BruggemanLois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com

