-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathFeatureFilterEvaluationContext.cs
More file actions
39 lines (35 loc) · 1.6 KB
/
FeatureFilterEvaluationContext.cs
File metadata and controls
39 lines (35 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
//
using Microsoft.Extensions.Configuration;
using System.Threading;
namespace Microsoft.FeatureManagement
{
/// <summary>
/// A context used by <see cref="IFeatureFilter"/> to gain insight into what feature is being evaluated and the parameters needed to check whether the feature should be enabled.
/// </summary>
public class FeatureFilterEvaluationContext
{
/// <summary>
/// The name of the feature being evaluated.
/// </summary>
public string FeatureName { get; set; }
/// <summary>
/// The settings provided for the feature filter to use when evaluating whether the feature should be enabled.
/// </summary>
public IConfiguration Parameters { get; set; }
/// <summary>
/// A settings object, if any, provided for the feature filter to use when evaluating whether the feature should be enabled.
/// This property is populated in two cases:
/// <list type="bullet">
/// <item>For features that provide parameters as an object, via <see cref="FeatureFilterConfiguration.ParametersObject"/>.</item>
/// <item>For <see cref="IFeatureFilter"/>s that implement <see cref="IFilterParametersBinder"/>.</item>
/// </list>
/// </summary>
public object Settings { get; set; }
/// <summary>
/// A cancellation token that can be used to request cancellation of the feature evaluation operation.
/// </summary>
public CancellationToken CancellationToken { get; set; }
}
}