Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​Extensions.​DependencyInjection.​FromKeyedServicesAttribute
Assembly: Microsoft.Extensions.DependencyInjection.Abstractions
Inheritance: object → System.​Attribute → FromKeyedServicesAttribute
Indicates that the parameter should be bound using the keyed service registered with the specified key.
Properties
public
object
Key
The key of the keyed service to bind to.
Remarks A <see langword="null" /> value with indicates there is not a key and just the parameter type is used to resolve the service.
This is useful for DI implementations that require an explict way to declare that the parameter should be resolved for unkeyed services.
A <see langword="null" /> value is also used along with <see cref="P:Microsoft.Extensions.DependencyInjection.FromKeyedServicesAttribute.LookupMode" /> set to <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceKeyLookupMode.InheritKey" /> to indicate that the key should be inherited from the parent scope.
public
ServiceKeyLookupMode
LookupMode
Gets the mode used to look up the service key.
public
object
TypeId
Methods
protected
void
Finalize​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object