<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0-preview.5.25277.114" />

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 { [NullableContext(2)] [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; } } }