Click or drag to resize

UserBuilder Method (String)

Creates an IUserBuilder for constructing a user object using a fluent syntax.

Namespace:  LaunchDarkly.Client
Assembly:  LaunchDarkly.CommonSdk (in LaunchDarkly.CommonSdk.dll) Version: 2.11.1
public static IUserBuilder Builder(
	string key


Type: SystemString
a string that uniquely identifies a user

Return Value

Type: IUserBuilder
a builder object

This is the preferred method for building a User if you are setting properties besides the Key. The IUserBuilder has methods for setting any number of properties, after which you call Build to get the resulting User instance.

This is different from using the extension methods such as AndName(User, String), which modify the properties of an existing User instance. Those methods are now deprecated, because in a future version of the SDK, User will be an immutable object.

var user = User.Builder("my-key").Name("Bob").Email("").Build();
See Also