-
Notifications
You must be signed in to change notification settings - Fork 111
/
IFeatureManager.cs
35 lines (32 loc) · 1.42 KB
/
IFeatureManager.cs
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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
//
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Microsoft.FeatureManagement
{
/// <summary>
/// Used to evaluate whether a feature is enabled or disabled.
/// </summary>
public interface IFeatureManager
{
/// <summary>
/// Retrieves a list of feature names registered in the feature manager.
/// </summary>
/// <returns>An enumerator which provides asynchronous iteration over the feature names registered in the feature manager.</returns>
IAsyncEnumerable<string> GetFeatureNamesAsync();
/// <summary>
/// Checks whether a given feature is enabled.
/// </summary>
/// <param name="feature">The name of the feature to check.</param>
/// <returns>True if the feature is enabled, otherwise false.</returns>
Task<bool> IsEnabledAsync(string feature);
/// <summary>
/// Checks whether a given feature is enabled.
/// </summary>
/// <param name="feature">The name of the feature to check.</param>
/// <param name="context">A context providing information that can be used to evaluate whether a feature should be on or off.</param>
/// <returns>True if the feature is enabled, otherwise false.</returns>
Task<bool> IsEnabledAsync<TContext>(string feature, TContext context);
}
}