Microsoft.Azure.Commands.Network.RemoveAzureApplicationGatewayBackendAddressPoolCommand.ExecuteCmdlet C# (CSharp) Method

ExecuteCmdlet() public method

public ExecuteCmdlet ( ) : void
return void
        public override void ExecuteCmdlet()
        {
            if (ShouldProcess(Name, Microsoft.Azure.Commands.Network.Properties.Resources.RemoveResourceMessage))
            {
                base.ExecuteCmdlet();

                var backendAddressPool = this.ApplicationGateway.BackendAddressPools.SingleOrDefault
                    (resource => string.Equals(resource.Name, this.Name, System.StringComparison.CurrentCultureIgnoreCase));

                if (backendAddressPool != null)
                {
                    this.ApplicationGateway.BackendAddressPools.Remove(backendAddressPool);
                }

                WriteObject(this.ApplicationGateway);
            }
        }
    }
RemoveAzureApplicationGatewayBackendAddressPoolCommand