ServiceHealthBehavior.TryParseBooleanQueryParameter Method

Definition

Attempts to parse a Boolean query string parameter and returns a value that indicates whether the parsing operation succeeded.

protected static bool TryParseBooleanQueryParameter (string parameterName, string parameter, bool defaultValue, out bool result);

Parameters

parameterName
String

The name of the parameter whose value the method attempts to parse.

parameter
String

The field/value pair of the query string.

defaultValue
Boolean

The value to be assigned to the result argument if the parsing operation fails.

result
Boolean

When the method returns, the value of the parsed Boolean argument.

Returns

true if the parsing operation succeeded; otherwise, false.

Exceptions

parameterName is null.

-or-

parameter is null.

Remarks

The method returns true if the value of the field was successfully parsed by the Boolean.TryParse method.

Applies to

Product Versions
.NET Framework 4.8, 4.8.1