Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Niko/dotnet new template #554

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Niko/dotnet new template #554

wants to merge 3 commits into from

Conversation

nikomancy
Copy link
Contributor

What?

Breaking out the Dotnet docs into the multipage template we use for Javascript.

Why?

  • The goal is to make the learning journey for engineers working with specific SDKs easier.
  • Content is easier to find in the TOC improving navigability.
  • Code samples for typed examples have been added for ease of use.
  • Boilerplate prose docs have been added to allow engineers to learn about relevant conceptual information along side the code without having to context switch to other parts of the docs.

Todo before merge

  • Update redirects
  • delete dotnet.md

Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for eppo-data-docs ready!

Name Link
🔨 Latest commit e0bf646
🔍 Latest deploy log https://app.netlify.com/sites/eppo-data-docs/deploys/6778856e31d7d40008af644c
😎 Deploy Preview https://deploy-preview-554--eppo-data-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@typotter typotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall.
Mostly just nits. Thanks Niko!


The Eppo .NET SDK enables feature flags and experiments in your .NET applications with only a few lines of code.

The SDK handles all the complexity of feature flag evaluation and experiment assignment locally in your application, with no network calls required after initial setup. This guide will walk you through installing the SDK and implementing your first feature flag, experiment, and contextual bandit.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This SDK is primarily a server SDK and will poll for updated configuration every 30sec (configurable), so there are actually continuous network calls.

| `GetStringAssignment()` | String |
| `GetBooleanAssignment()` | Boolean |
| `GetJSONAssignment()` | JSON object |
| `GetIntegerAssignment()` | Integer |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returns a long

| `GetBooleanAssignment()` | Boolean |
| `GetJSONAssignment()` | JSON object |
| `GetIntegerAssignment()` | Integer |
| `GetNumericAssignment()` | Float |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: returns a Double


For bandits, you'll need both an assignment logger and a bandit logger:

```csharp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

["pricingTier"] = "1"
};

var actions = new Dictionary<string, IDictionary<string, object?>>()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a helper class, ContextAttributes which makes this typing a little simpler. Check out
https://github.com/Eppo-exp/dot-net-server-sdk/blob/89f65bb5779a7293beff878534381dcc871b03cd/dot-net-sdk/EppoClient.cs#L334

Comment on lines +101 to +107
var defaultAssignment = new Dictionary<string, object>
{
["hero"] = false,
["heroImage"] = "placeholder.png",
["heroTitle"] = "Placeholder Hero Title",
["heroDescription"] = "Placeholder Hero Description"
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var defaultAssignment = new Dictionary<string, object>
{
["hero"] = false,
["heroImage"] = "placeholder.png",
["heroTitle"] = "Placeholder Hero Title",
["heroDescription"] = "Placeholder Hero Description"
};
var defaultAssignment = (JObject)(new Dictionary<string, object>
{
["hero"] = false,
["heroImage"] = "placeholder.png",
["heroTitle"] = "Placeholder Hero Title",
["heroDescription"] = "Placeholder Hero Description"
});

## Usage with Contextual Multi-Armed Bandits

Eppo also supports contextual multi-armed bandits. You can read more about them in the [high-level documentation](/contextual-bandits).
Bandit flag configuration--including setting up the flag key, status quo variation, bandit variation, and targeting rules--are configured within
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an emdash is the correct punctuation here
ex:
Bandit flag configuration &mdash; including setting up the flag key

["pricingTier"] = "1"
};

var actions = new Dictionary<string, IDictionary<string, object?>>()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, consider using the ContextAttributes class here


### `GetBanditAction` Overloads

There are several overloads of the `GetBanditAction()` method available:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can link to the source code for full examples of using the convenient overloads

The action context contains contextual information about each action. They can be provided as a mapping of attribute names
to their contexts.

Similar to subject context, action contexts can be provided as `IDictionary<string, object?>`--which will then assume anything that is a number is a numeric
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emdash here as well
(there are some markdown post-processors which can convert -- to a proper emdash, which is maybe what you're doing here, but it doesn't look like netlify is doing such post processing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants