FromKeyedServicesAttribute.Key 属性

定义

要绑定到的键服务密钥。

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

属性值

注解

指示 null 没有键的值,并且只使用参数类型来解析服务。 这对于需要以说明方式声明应为未键服务解析参数的 DI 实现非常有用。 null值还与LookupMode设置为指示InheritKey应从父范围继承密钥一起使用。

适用于