@@ -24,30 +24,20 @@ internal class VariantServiceProvider<TService> : IVariantServiceProvider<TServi
24
24
/// <summary>
25
25
/// Creates a variant service provider.
26
26
/// </summary>
27
+ /// <param name="featureName">The feature flag that should be used to determine which variant of the service should be used.</param>
28
+ /// <param name="featureManager">The feature manager to get the assigned variant of the feature flag.</param>
27
29
/// <param name="services">Implementation variants of TService.</param>
28
- /// <param name="featureManager">Feature manager to get the assigned variant of the variant feature flag.</param>
29
- /// <exception cref="ArgumentNullException">Thrown if <paramref name="services"/> is null.</exception>
30
+ /// <exception cref="ArgumentNullException">Thrown if <paramref name="featureName"/> is null.</exception>
30
31
/// <exception cref="ArgumentNullException">Thrown if <paramref name="featureManager"/> is null.</exception>
31
- public VariantServiceProvider ( IEnumerable < TService > services , IVariantFeatureManager featureManager )
32
+ /// <exception cref="ArgumentNullException">Thrown if <paramref name="services"/> is null.</exception>
33
+ public VariantServiceProvider ( string featureName , IVariantFeatureManager featureManager , IEnumerable < TService > services )
32
34
{
33
- _services = services ?? throw new ArgumentNullException ( nameof ( services ) ) ;
35
+ _featureName = featureName ?? throw new ArgumentNullException ( nameof ( featureName ) ) ;
34
36
_featureManager = featureManager ?? throw new ArgumentNullException ( nameof ( featureManager ) ) ;
37
+ _services = services ?? throw new ArgumentNullException ( nameof ( services ) ) ;
35
38
_variantServiceCache = new ConcurrentDictionary < string , TService > ( ) ;
36
39
}
37
40
38
- /// <summary>
39
- /// The variant feature flag used to assign variants.
40
- /// </summary>
41
- public string FeatureName
42
- {
43
- get => _featureName ;
44
-
45
- init
46
- {
47
- _featureName = value ?? throw new ArgumentNullException ( nameof ( value ) ) ;
48
- }
49
- }
50
-
51
41
/// <summary>
52
42
/// Gets implementation of TService according to the assigned variant from the feature flag.
53
43
/// </summary>
0 commit comments