Microsoft.Azure.Commands.Network.ExpressRouteCircuitBaseCmdlet.IsExpressRouteCircuitPresent C# (CSharp) Method

IsExpressRouteCircuitPresent() public method

public IsExpressRouteCircuitPresent ( string resourceGroupName, string name ) : bool
resourceGroupName string
name string
return bool
        public bool IsExpressRouteCircuitPresent(string resourceGroupName, string name)
        {
            try
            {
                GetExpressRouteCircuit(resourceGroupName, name);
            }
            catch (Microsoft.Rest.Azure.CloudException exception)
            {
                if (exception.Response.StatusCode == HttpStatusCode.NotFound)
                {
                    // Resource is not present
                    return false;
                }

                throw;
            }

            return true;
        }