---
title: Update from older versions of the C# SDK
slug: feature-experimentation/docs/migrate-from-older-versions-csharp
createdAt: 2026-08-05T20:39:58.000Z
---

This section provides code examples for how You should leveraging the new [Decision](docId\:ZMDop0dV_4wumJveX2n7q) and [Event Tracking](docId\:VwQ9VeRVVka_1NGkB9Wm-) APIs. All existing [Full Stack (Legacy)](docId:6_ik6SSz-WyJLWuCQw7BT) methods and implementation are still supported. See [Optimizely Feature Experimentation - application & migration](docId\:IUHqAimUTD7qd2FENlvSw) documentation for the latest updates.

You should adopting the new `Decide`, `Decide All`, and `Track Event` methods as a more flexible and easier-to-use replacement where you currently use `IsFeatureEnabled`, `GetFeatureVariable`, `GetAllFeatures`, or `Track` calls within your implementation.

The following are examples of how to migrate the Full Stack (Legacy) methods to Feature Experimentation methods:

```csharp
using OptimizelySDK;
using OptimizelySDK.Entity;
using OptimizelySDK.OptimizelyDecisions;

/*
 * Prerequisites for new methods: create a user
 */
var optimizely = OptimizelyFactory.NewDefaultInstance("YOUR_SDK_KEY");
var attributes = new UserAttributes
{
    { "is_logged_in", true }
};
var user = optimizely.CreateUserContext("user_123", attributes);

/*
 * Is Feature Enabled
 */
// old method
bool enabled = optimizely.IsFeatureEnabled("flag_1", "user_123", attributes);

// new method
var decision = user.Decide("flag_1");
bool enabled = decision.Enabled;

/*
 * Activate & Get Variation
 */
// old method
var variation = optimizely.Activate("experiment_1", "user_123", attributes);

// new method
var variationKey = decision.VariationKey;

/*
 * Get All Feature Variables
 */
// old method
var json = optimizely.GetAllFeatureVariables("flag_1", "user_123", attributes);

// new method
var json = decision.Variables;

/*
 * Get Enabled Features
 */
// old method
var enabledFlags = optimizely.GetEnabledFeatures("user_123", attributes);

// new method
var options = new[] { OptimizelyDecideOption.ENABLED_FLAGS_ONLY };
var decisions = user.DecideAll(options);
var enabledFlags = decisions.Keys;

/*
 * Track
 */
// old method
var tags = new EventTags
{
    { "revenue", 42 }
};
tags.Add("purchase_count", 2);
optimizely.Track("my_purchase_event_key", "user_123", attributes, tags);

// new method
user.TrackEvent("my_purchase_event_key", tags);
```
