@@ -24,30 +24,20 @@ internal class VariantServiceProvider<TService> : IVariantServiceProvider<TServi
2424 /// <summary>
2525 /// Creates a variant service provider.
2626 /// </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>
2729 /// <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>
3031 /// <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 )
3234 {
33- _services = services ?? throw new ArgumentNullException ( nameof ( services ) ) ;
35+ _featureName = featureName ?? throw new ArgumentNullException ( nameof ( featureName ) ) ;
3436 _featureManager = featureManager ?? throw new ArgumentNullException ( nameof ( featureManager ) ) ;
37+ _services = services ?? throw new ArgumentNullException ( nameof ( services ) ) ;
3538 _variantServiceCache = new ConcurrentDictionary < string , TService > ( ) ;
3639 }
3740
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-
5141 /// <summary>
5242 /// Gets implementation of TService according to the assigned variant from the feature flag.
5343 /// </summary>
0 commit comments