@@ -144,7 +144,7 @@ public async Task<bool> IsEnabledAsync(string feature)
144144 /// Checks whether a given feature is enabled.
145145 /// </summary>
146146 /// <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>
148148 /// <returns>True if the feature is enabled, otherwise false.</returns>
149149 public async Task < bool > IsEnabledAsync < TContext > ( string feature , TContext appContext )
150150 {
@@ -170,7 +170,7 @@ public async ValueTask<bool> IsEnabledAsync(string feature, CancellationToken ca
170170 /// Checks whether a given feature is enabled.
171171 /// </summary>
172172 /// <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>
174174 /// <param name="cancellationToken">The cancellation token to cancel the operation.</param>
175175 /// <returns>True if the feature is enabled, otherwise false.</returns>
176176 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
228228 /// <param name="context">A context that provides information to evaluate which variant will be assigned to the user.</param>
229229 /// <param name="cancellationToken">The cancellation token to cancel the operation.</param>
230230 /// <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 )
232232 {
233233 if ( string . IsNullOrEmpty ( feature ) )
234234 {
@@ -318,7 +318,7 @@ private async ValueTask<EvaluationEvent> EvaluateFeature<TContext>(string featur
318318
319319 if ( useContext )
320320 {
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.";
322322 }
323323 else if ( TargetingContextAccessor == null )
324324 {
@@ -500,7 +500,7 @@ private async ValueTask<bool> IsEnabledAsync<TContext>(FeatureDefinition feature
500500
501501 if ( useAppContext )
502502 {
503- filter = GetFeatureFilterMetadata ( featureFilterConfiguration . Name , typeof ( TContext ) ) ??
503+ filter = GetFeatureFilterMetadata ( featureFilterConfiguration . Name , appContext . GetType ( ) ) ??
504504 GetFeatureFilterMetadata ( featureFilterConfiguration . Name ) ;
505505 }
506506 else
@@ -542,7 +542,7 @@ private async ValueTask<bool> IsEnabledAsync<TContext>(FeatureDefinition feature
542542 // IContextualFeatureFilter
543543 if ( useAppContext )
544544 {
545- ContextualFeatureFilterEvaluator contextualFilter = GetContextualFeatureFilter ( featureFilterConfiguration . Name , typeof ( TContext ) ) ;
545+ ContextualFeatureFilterEvaluator contextualFilter = GetContextualFeatureFilter ( featureFilterConfiguration . Name , appContext . GetType ( ) ) ;
546546
547547 if ( contextualFilter != null &&
548548 await contextualFilter . EvaluateAsync ( context , appContext ) . ConfigureAwait ( false ) == targetEvaluation )
0 commit comments