Advertisement
gn4711

Linq ForEach SPWebcollection

Mar 1st, 2012
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.27 KB | None | 0 0
  1. public static void ForEach(this SPWebCollection webs,
  2.                            Action<SPWeb> action,
  3.                            Func<SPWeb, bool> predicate)
  4. {
  5.     foreach (SPWeb web in webs.Where(predicate))
  6.     {
  7.         action(web);
  8.         web.Dispose();
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement