<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0-rc.1.25451.107" />

FromKeyedServicesAttribute

Indicates that the parameter should be bound using the keyed service registered with the specified key.
using System; using System.Runtime.CompilerServices; namespace Microsoft.Extensions.DependencyInjection { [System.Runtime.CompilerServices.NullableContext(2)] [System.Runtime.CompilerServices.Nullable(0)] [AttributeUsage(AttributeTargets.Parameter)] public class FromKeyedServicesAttribute : Attribute { public object Key { get; } public ServiceKeyLookupMode LookupMode { get; } public FromKeyedServicesAttribute(object key) { Key = key; LookupMode = ((key == null) ? ServiceKeyLookupMode.NullKey : ServiceKeyLookupMode.ExplicitKey); } public FromKeyedServicesAttribute() { Key = null; LookupMode = ServiceKeyLookupMode.InheritKey; } } }