LaunchDarkly Dotnet Client SDK
Search Results for

    Show / Hide Table of Contents

    Interface IUserBuilderCanMakeAttributePrivate

    An extension of IUserBuilder that allows attributes to be made private via the AsPrivateAttribute() method.

    Inherited Members
    IUserBuilder.Build()
    IUserBuilder.Key(string)
    IUserBuilder.IPAddress(string)
    IUserBuilder.Country(string)
    IUserBuilder.FirstName(string)
    IUserBuilder.LastName(string)
    IUserBuilder.Name(string)
    IUserBuilder.Avatar(string)
    IUserBuilder.Email(string)
    IUserBuilder.Anonymous(bool)
    IUserBuilder.Custom(string, LdValue)
    IUserBuilder.Custom(string, bool)
    IUserBuilder.Custom(string, string)
    IUserBuilder.Custom(string, int)
    IUserBuilder.Custom(string, long)
    IUserBuilder.Custom(string, float)
    IUserBuilder.Custom(string, double)
    Namespace: LaunchDarkly.Sdk
    Assembly: LaunchDarkly.CommonSdk.dll
    Syntax
    public interface IUserBuilderCanMakeAttributePrivate : IUserBuilder
    Remarks

    IUserBuilder setter methods for attribute that can be made private always return this interface, rather than returning IUserBuilder. See AsPrivateAttribute() for more details.

    Methods

    AsPrivateAttribute()

    Marks the last attribute that was set on this builder as being a private attribute: that is, its value will not be sent to LaunchDarkly.

    Declaration
    IUserBuilder AsPrivateAttribute()
    Returns
    Type Description
    IUserBuilder

    the same builder

    Remarks

    This action only affects analytics events that are generated by this particular user object. To mark some (or all) user attributes as private for all users, use the configuration properties PrivateAttributeName and AllAttributesPrivate.

    Not all attributes can be made private: Key(string) and Anonymous(bool) cannot be private. This is enforced by the compiler, since the builder methods for attributes that can be made private are the only ones that return IUserBuilderCanMakeAttributePrivate; therefore, you cannot write an expression like User.Builder("user-key").AsPrivateAttribute().

    Examples

    In this example, FirstName and LastName are marked as private, but Country is not.

    var user = User.Builder("user-key")
        .FirstName("Pierre").AsPrivateAttribute()
        .LastName("Menard").AsPrivateAttribute()
        .Country("ES")
        .Build();
    In this article
    Back to top Generated by DocFX
    OSZAR »