Click or drag to resize

LdClientBoolVariation Method

Calculates the boolean value of a feature flag for a given user.

Namespace:  LaunchDarkly.Client
Assembly:  LaunchDarkly.ServerSdk (in LaunchDarkly.ServerSdk.dll) Version: 5.13.0
Syntax
public bool BoolVariation(
	string key,
	User user,
	bool defaultValue = false
)

Parameters

key
Type: SystemString
the unique feature key for the feature flag
user
Type: LaunchDarkly.ClientUser
the end user requesting the flag
defaultValue (Optional)
Type: SystemBoolean
the default value of the flag

Return Value

Type: Boolean
the variation for the given user, or defaultValue if the flag cannot be evaluated

Implements

ILdClientBoolVariation(String, User, Boolean)
Remarks

If the flag variation does not have a boolean value, defaultValue is returned.

If an error makes it impossible to evaluate the flag (for instance, the feature flag key does not match any existing flag), defaultValue is returned.

See Also