Share via


FromKeyedServicesAttribute.Key Property

Definition

The key of the keyed service to bind to.

public:
 property System::Object ^ Key { System::Object ^ get(); };
public object? Key { get; }
member this.Key : obj
Public ReadOnly Property Key As Object

Property Value

Remarks

A 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 null value is also used along with LookupMode set to InheritKey to indicate that the key should be inherited from the parent scope.

Applies to