public void Dispose() { if (_asyncFlowControl != default) { _asyncFlowControl.Dispose(); } }
internal static SecurityContext CaptureSecurityContextNoIdentityFlow() { SecurityContext securityContext; if (!SecurityContext.IsWindowsIdentityFlowSuppressed()) { AsyncFlowControl asyncFlowControl = SecurityContext.SuppressFlowWindowsIdentity(); try { securityContext = SecurityContext.Capture(); } finally { asyncFlowControl.Dispose(); } return(securityContext); } else { return(SecurityContext.Capture()); } }