AL.Sharepoint.Core.Utils.SPUtils.WebOp C# (CSharp) Method

WebOp() public static method

public static WebOp ( string webUrl, Action op ) : void
webUrl string
op Action
return void
        public static void WebOp(string webUrl, Action<SPWeb> op)
        {
            SiteOp(webUrl, site =>
            {
                using (SPWeb web = site.OpenWeb())
                {
                    bool auuOrig = false;
                    try
                    {
                        auuOrig = web.AllowUnsafeUpdates;
                        web.AllowUnsafeUpdates = true;
                        op(web);
                    }
                    catch (Exception ex)
                    {
                        DiagnosticLog.Error(op.Method.Name, ex +
                                           (ex.InnerException != null ? "::" + ex.InnerException : string.Empty));
                        throw;
                    }
                    finally
                    {
                        web.AllowUnsafeUpdates = auuOrig;
                    }
                }
            });
        }