Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class SPWebExtensions
- {
- public static void RunWithUnsafeUpdates(this SPWeb currentWeb, Action action)
- {
- bool allowUnsafeUpdates = currentWeb.AllowUnsafeUpdates;
- currentWeb.AllowUnsafeUpdates = true;
- try
- {
- action.Invoke();
- }
- finally
- {
- currentWeb.AllowUnsafeUpdates = allowUnsafeUpdates;
- }
- }
- }
Add Comment
Please, Sign In to add comment