Skip to content

Instantly share code, notes, and snippets.

@eirikb
Created November 4, 2012 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eirikb/a7c6efb2360382933896 to your computer and use it in GitHub Desktop.
Save eirikb/a7c6efb2360382933896 to your computer and use it in GitHub Desktop.
Loop all SPLists in all SPWebs in current SPSite
SPContext.Current.Site.AllWebs.ToList().ForEach(web =>
{
web.Lists.Cast<SPList>().ToList().ForEach(list =>
{
// Do work
});
web.Dispose();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment