1
- using System ;
2
1
using System . Collections . Concurrent ;
3
2
using System . Collections . Generic ;
4
3
using System . Linq ;
5
4
using System . Threading ;
6
5
using Microsoft . Extensions . Logging ;
7
- using OpenFeatureSDK . Model ;
6
+ using OpenFeature . Model ;
8
7
9
- namespace OpenFeatureSDK
8
+ namespace OpenFeature
10
9
{
11
10
/// <summary>
12
11
/// The evaluation API allows for the evaluation of feature flag values, independent of any flag control plane or vendor.
13
12
/// In the absence of a provider the evaluation API uses the "No-op provider", which simply returns the supplied default flag value.
14
13
/// </summary>
15
14
/// <seealso href="https://github.com/open-feature/spec/blob/main/specification/flag-evaluation.md#flag-evaluation-api"/>
16
- public sealed class OpenFeature
15
+ public sealed class Api
17
16
{
18
17
private EvaluationContext _evaluationContext = EvaluationContext . Empty ;
19
18
private FeatureProvider _featureProvider = new NoOpFeatureProvider ( ) ;
@@ -24,15 +23,15 @@ public sealed class OpenFeature
24
23
private readonly ReaderWriterLockSlim _featureProviderLock = new ReaderWriterLockSlim ( ) ;
25
24
26
25
/// <summary>
27
- /// Singleton instance of OpenFeature
26
+ /// Singleton instance of Api
28
27
/// </summary>
29
- public static OpenFeature Instance { get ; } = new OpenFeature ( ) ;
28
+ public static Api Instance { get ; } = new Api ( ) ;
30
29
31
30
// Explicit static constructor to tell C# compiler
32
31
// not to mark type as beforefieldinit
33
32
// IE Lazy way of ensuring this is thread safe without using locks
34
- static OpenFeature ( ) { }
35
- private OpenFeature ( ) { }
33
+ static Api ( ) { }
34
+ private Api ( ) { }
36
35
37
36
/// <summary>
38
37
/// Sets the feature provider
@@ -58,7 +57,7 @@ public void SetProvider(FeatureProvider featureProvider)
58
57
/// it should be accessed once for an operation, and then that reference should be used for all dependent
59
58
/// operations. For instance, during an evaluation the flag resolution method, and the provider hooks
60
59
/// should be accessed from the same reference, not two independent calls to
61
- /// <see cref="OpenFeature .GetProvider"/>.
60
+ /// <see cref="Api .GetProvider"/>.
62
61
/// </para>
63
62
/// </summary>
64
63
/// <returns><see cref="FeatureProvider"/></returns>
@@ -80,7 +79,7 @@ public FeatureProvider GetProvider()
80
79
/// <para>
81
80
/// This method is not guaranteed to return the same provider instance that may be used during an evaluation
82
81
/// in the case where the provider may be changed from another thread.
83
- /// For multiple dependent provider operations see <see cref="OpenFeature .GetProvider"/>.
82
+ /// For multiple dependent provider operations see <see cref="Api .GetProvider"/>.
84
83
/// </para>
85
84
/// </summary>
86
85
/// <returns><see cref="ClientMetadata"/></returns>
@@ -111,7 +110,7 @@ public FeatureClient GetClient(string name = null, string version = null, ILogge
111
110
/// Adds a hook to global hooks list
112
111
/// <para>
113
112
/// Hooks which are dependent on each other should be provided in a collection
114
- /// using the <see cref="AddHooks(System.Collections.Generic.IEnumerable{OpenFeatureSDK. Hook})"/>.
113
+ /// using the <see cref="AddHooks(System.Collections.Generic.IEnumerable{Hook})"/>.
115
114
/// </para>
116
115
/// </summary>
117
116
/// <param name="hook">Hook that implements the <see cref="Hook"/> interface</param>
0 commit comments