Skip to content

Commit e2f8619

Browse files
author
Минин Степан Александрович
committed
docs(VariantServiceProvider): ResolveVariantService
- added comments Closes #564
1 parent 67c22d5 commit e2f8619

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Microsoft.FeatureManagement/VariantServiceProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,17 @@ private async Task<TService> ResolveByStatusAsync(CancellationToken cancellation
7777

7878
private TService ResolveVariantService(object variantKey)
7979
{
80+
//
81+
// Prefer keyed resolution when supported. This enables lazy instantiation of variant implementations.
8082
if (TryGetKeyedVariantService(variantKey, out var keyedVariantService))
8183
{
8284
return keyedVariantService;
8385
}
8486

8587
if (variantKey is string variantName)
8688
{
89+
//
90+
// Fall back to scanning non-keyed registrations and matching by VariantServiceAliasAttribute or type name.
8791
return GetVariantServiceFallback(variantName);
8892
}
8993

0 commit comments

Comments
 (0)