Azure.ResourceManager.AppService.HostingEnvironmentWorkerPoolCollection.Exists C# (CSharp) Method

Exists() public method

public Exists ( string workerPoolName, CancellationToken cancellationToken = default ) : Response
workerPoolName string
cancellationToken CancellationToken
return Response
        public virtual Response<bool> Exists(string workerPoolName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(workerPoolName, nameof(workerPoolName));

            using var scope = _hostingEnvironmentWorkerPoolAppServiceEnvironmentsClientDiagnostics.CreateScope("HostingEnvironmentWorkerPoolCollection.Exists");
            scope.Start();
            try
            {
                var response = GetIfExists(workerPoolName, cancellationToken: cancellationToken);
                return Response.FromValue(response.Value != null, response.GetRawResponse());
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }