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;
}