@@ -144,7 +144,7 @@ public async Task<bool> IsEnabledAsync(string feature)
144
144
/// Checks whether a given feature is enabled.
145
145
/// </summary>
146
146
/// <param name="feature">The name of the feature to check.</param>
147
- /// <param name="appContext">A context that provides information that can be used to evaluate whether a feature should be on or off.</param>
147
+ /// <param name="appContext">A context that provides information to evaluate whether a feature should be on or off.</param>
148
148
/// <returns>True if the feature is enabled, otherwise false.</returns>
149
149
public async Task < bool > IsEnabledAsync < TContext > ( string feature , TContext appContext )
150
150
{
@@ -170,7 +170,7 @@ public async ValueTask<bool> IsEnabledAsync(string feature, CancellationToken ca
170
170
/// Checks whether a given feature is enabled.
171
171
/// </summary>
172
172
/// <param name="feature">The name of the feature to check.</param>
173
- /// <param name="appContext">A context that provides information that can be used to evaluate whether a feature should be on or off.</param>
173
+ /// <param name="appContext">A context that provides information to evaluate whether a feature should be on or off.</param>
174
174
/// <param name="cancellationToken">The cancellation token to cancel the operation.</param>
175
175
/// <returns>True if the feature is enabled, otherwise false.</returns>
176
176
public async ValueTask < bool > IsEnabledAsync < TContext > ( string feature , TContext appContext , CancellationToken cancellationToken = default )
@@ -228,7 +228,7 @@ public async ValueTask<Variant> GetVariantAsync(string feature, CancellationToke
228
228
/// <param name="context">A context that provides information to evaluate which variant will be assigned to the user.</param>
229
229
/// <param name="cancellationToken">The cancellation token to cancel the operation.</param>
230
230
/// <returns>A variant assigned to the user based on the feature's configured allocation.</returns>
231
- public async ValueTask < Variant > GetVariantAsync < TContext > ( string feature , TContext context , CancellationToken cancellationToken = default )
231
+ public async ValueTask < Variant > GetVariantAsync ( string feature , ITargetingContext context , CancellationToken cancellationToken = default )
232
232
{
233
233
if ( string . IsNullOrEmpty ( feature ) )
234
234
{
@@ -318,7 +318,7 @@ private async ValueTask<EvaluationEvent> EvaluateFeature<TContext>(string featur
318
318
319
319
if ( useContext )
320
320
{
321
- message = $ "A { nameof ( ITargetingContext ) } required for variant assignment was not provided .";
321
+ message = $ "The context of type { context . GetType ( ) . Name } does not implement { nameof ( ITargetingContext ) } for variant assignment.";
322
322
}
323
323
else if ( TargetingContextAccessor == null )
324
324
{
@@ -500,7 +500,7 @@ private async ValueTask<bool> IsEnabledAsync<TContext>(FeatureDefinition feature
500
500
501
501
if ( useAppContext )
502
502
{
503
- filter = GetFeatureFilterMetadata ( featureFilterConfiguration . Name , typeof ( TContext ) ) ??
503
+ filter = GetFeatureFilterMetadata ( featureFilterConfiguration . Name , appContext . GetType ( ) ) ??
504
504
GetFeatureFilterMetadata ( featureFilterConfiguration . Name ) ;
505
505
}
506
506
else
@@ -542,7 +542,7 @@ private async ValueTask<bool> IsEnabledAsync<TContext>(FeatureDefinition feature
542
542
// IContextualFeatureFilter
543
543
if ( useAppContext )
544
544
{
545
- ContextualFeatureFilterEvaluator contextualFilter = GetContextualFeatureFilter ( featureFilterConfiguration . Name , typeof ( TContext ) ) ;
545
+ ContextualFeatureFilterEvaluator contextualFilter = GetContextualFeatureFilter ( featureFilterConfiguration . Name , appContext . GetType ( ) ) ;
546
546
547
547
if ( contextualFilter != null &&
548
548
await contextualFilter . EvaluateAsync ( context , appContext ) . ConfigureAwait ( false ) == targetEvaluation )
@@ -788,6 +788,8 @@ private IFeatureFilterMetadata GetFeatureFilterMetadata(string filterName, Type
788
788
}
789
789
}
790
790
791
+ var t = matchingFilters . FirstOrDefault ( ) ;
792
+
791
793
return matchingFilters . FirstOrDefault ( ) ;
792
794
}
793
795
) ;
0 commit comments