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.03k stars 111 forks source link

Use ITargetingContext when calling GetVariantAsync #484

Closed zhiyuanliang-ms closed 3 weeks ago

zhiyuanliang-ms commented 1 month 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.