File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
src/Microsoft.FeatureManagement Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ public interface IVariantServiceProvider<TService> where TService : class
1414 /// <summary>
1515 /// Gets an implementation variant of TService.
1616 /// </summary>
17- /// <param name="cancellationToken">The cancellation token to cancel the operation.</param>
1817 /// <returns>An implementation of TService.</returns>
19- ValueTask < TService > GetAsync ( CancellationToken cancellationToken ) ;
18+ TService GetService ( ) ;
2019 }
2120}
Original file line number Diff line number Diff line change @@ -42,13 +42,12 @@ public string VariantFeatureName
4242 /// <summary>
4343 /// Gets implementation of TService according to the assigned variant from the feature flag.
4444 /// </summary>
45- /// <param name="cancellationToken">The cancellation token to cancel the operation.</param>
4645 /// <returns>An implementation matched with the assigned variant. If there is no matched implementation, it will return null.</returns>
47- public async ValueTask < TService > GetAsync ( CancellationToken cancellationToken )
46+ public TService GetService ( )
4847 {
4948 Debug . Assert ( _variantFeatureName != null ) ;
5049
51- Variant variant = await _featureManager . GetVariantAsync ( _variantFeatureName , cancellationToken ) ;
50+ Variant variant = _featureManager . GetVariantAsync ( _variantFeatureName , CancellationToken . None ) . GetAwaiter ( ) . GetResult ( ) ; ;
5251
5352 TService implementation = null ;
5453
You can’t perform that action at this time.
0 commit comments