/// <summary> /// Check if a site is closed /// </summary> /// <param name="web">Web to operate on</param> /// <returns>True if site is closed, false otherwise</returns> public static bool IsClosedBySitePolicy(this Web web) { var isClosed = ProjectPolicy.IsProjectClosed(web.Context, web); web.Context.ExecuteQueryRetry(); return(isClosed.Value); }
/// <summary> /// Check if a site is closed /// </summary> /// <param name="web">Web to operate on</param> /// <returns>True if site is closed, false otherwise</returns> private static async Task <bool> IsClosedBySitePolicyImplementation(this Web web) { var isClosed = ProjectPolicy.IsProjectClosed(web.Context, web); await web.Context.ExecuteQueryRetryAsync(); return(isClosed.Value); }
private static async Task <bool> IsClosedBySitePolicyImplementation(this Web web) #endif { var isClosed = ProjectPolicy.IsProjectClosed(web.Context, web); #if ONPREMISES web.Context.ExecuteQueryRetry(); #else await web.Context.ExecuteQueryRetryAsync(); #endif return(isClosed.Value); }