LaunchDarkly Dotnet Server SDK
Search Results for

    Show / Hide Table of Contents

    Class FeatureFlagsState

    A snapshot of the state of all feature flags with regard to a specific user. See calling AllFlagsState(Context, params FlagsStateOption[]).

    Inheritance
    object
    FeatureFlagsState
    Implements
    IJsonSerializable
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: LaunchDarkly.Sdk.Server
    Assembly: LaunchDarkly.ServerSdk.dll
    Syntax
    [JsonConverter(typeof(FeatureFlagsStateConverter))]
    public class FeatureFlagsState : IJsonSerializable
    Remarks

    Serializing this object to JSON using System.Text.Json or LdJsonSerialization will produce the appropriate data structure for bootstrapping the LaunchDarkly JavaScript client. Using Newtonsoft.Json will not work correctly without special handling; see LaunchDarkly.Sdk.Json for details.

    Properties

    | Edit this page View Source

    Valid

    True if this object contains a valid snapshot of feature flag state, or false if the state could not be computed (for instance, because the client was offline or there was no user).

    Declaration
    public bool Valid { get; }
    Property Value
    Type Description
    bool

    Methods

    | Edit this page View Source

    Builder(params FlagsStateOption[])

    Returns a builder for constructing a new instance of this class. May be useful in testing.

    Declaration
    public static FeatureFlagsStateBuilder Builder(params FlagsStateOption[] options)
    Parameters
    Type Name Description
    FlagsStateOption[] options

    the same options that can be passed to AllFlagsState(Context, params FlagsStateOption[])

    Returns
    Type Description
    FeatureFlagsStateBuilder

    a new FeatureFlagsStateBuilder

    | Edit this page View Source

    Equals(object)

    Declaration
    public override bool Equals(object other)
    Parameters
    Type Name Description
    object other
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)
    | Edit this page View Source

    GetFlagReason(string)

    Returns the evaluation reason of an individual feature flag (as returned by BoolVariation(string, Context, bool), etc.) at the time the state was recorded.

    Declaration
    public EvaluationReason? GetFlagReason(string key)
    Parameters
    Type Name Description
    string key

    the feature flag key

    Returns
    Type Description
    EvaluationReason?

    the evaluation reason; null if reasons were not recorded, or if there was no such flag

    | Edit this page View Source

    GetFlagValueJson(string)

    Returns the value of an individual feature flag at the time the state was recorded.

    Declaration
    public LdValue GetFlagValueJson(string key)
    Parameters
    Type Name Description
    string key

    the feature flag key

    Returns
    Type Description
    LdValue

    the flag's JSON value; Null if the flag returned the default value, or if there was no such flag

    | Edit this page View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()
    | Edit this page View Source

    ToValuesJsonMap()

    Returns a dictionary of flag keys to flag values.

    Declaration
    public IReadOnlyDictionary<string, LdValue> ToValuesJsonMap()
    Returns
    Type Description
    IReadOnlyDictionary<string, LdValue>

    a dictionary of flag keys to flag values

    Remarks

    If a flag would have evaluated to the default value, its value will be Null.

    Do not use this method if you are passing data to the front end to "bootstrap" the JavaScript client. Instead, serialize the FeatureFlagsState object to JSON using JsonConvert.SerializeObject().

    Implements

    IJsonSerializable
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX