adventurous-lamp-69236
06/27/2023, 4:44 PMbetter-magician-65629
06/27/2023, 4:59 PMSetAttributes
method on the GrowthBook
instance, but it looks like working with attributes is done in the Context
. https://github.com/growthbook/growthbook-c-sharp/blob/main/GrowthBook/Context.cs#L23
It's been a while since i've used C# but my thoughts are, with the getters and setters defined, and it being public and there being no explicit constructor defined, that you can pass your JObject in when constructing the Context, and if not, assign it after the Context is created. let me know how this goes.
I'll add a ticket for the maintainers to improve the documentation for the next time.
try something like this:
var attrs = new JObject();
attrs.Add("userid", "foo");
var gb = new GrowthBook.GrowthBook(
new Context(
Attributes = attrs,
Features = featuresResult.Features,
)
);
adventurous-lamp-69236
06/29/2023, 8:18 AM