microsoft / FeatureManagement-Dotnet

Microsoft.FeatureManagement provides standardized APIs for enabling feature flags within applications. Utilize this library to secure a consistent experience when developing applications that use patterns such as beta access, rollout, dark deployments, and more.
MIT License
1.05k stars 115 forks source link

Use ITargetingContext when calling GetVariantAsync #484

Closed zhiyuanliang-ms closed 2 months ago

zhiyuanliang-ms commented 4 months ago

Why this PR?

485

Visible Changes

  1. Updated IVariantFeatureManager.GetVariantAsync() method to

    ValueTask<Variant> GetVariantAsync(string feature, ITargetingContext context, CancellationToken cancellationToken = default);

    It will accept ITargetingContext instead of TargetingContext type.

  2. Added an entension method which is an overload of GetVariantAsync. This method will accept TargetingContext for discoverability.