1

Is it possible to get all webs in Farm or WebApplication with one Linq to SharePoint query?

Now my data context constructor takes only takes one argument, and that is one web. This way I need to loop though all webs, which feels clumsy and inefficient.

1 Answer 1

2

OOTB Linq2SharePoint data context (generated by SPMetal) can be used in scope of web, not application. There is no easy way to expand the context to application scope.

2
  • Yep, +1, and in addition: as far as I know, the only way to fetch cross-SPWeb data in one request, is to use CAML queries in conjunction with SPSiteDataQuery and SPWeb.GetSiteData method. And cross-site collection - there is no such capability at all... Sep 16, 2011 at 18:03
  • To bad it is not possible. I hoped Linq to SharePoint would be easier to work with than CAML.
    – Tim
    Sep 17, 2011 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.