FakeLogRecord.StructuredState 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取调用方在将日志记录创建为只读列表时提供的不透明状态。
public:
property System::Collections::Generic::IReadOnlyList<System::Collections::Generic::KeyValuePair<System::String ^, System::String ^>> ^ StructuredState { System::Collections::Generic::IReadOnlyList<System::Collections::Generic::KeyValuePair<System::String ^, System::String ^>> ^ get(); };
public System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<string,string?>>? StructuredState { get; }
member this.StructuredState : System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<string, string>>
Public ReadOnly Property StructuredState As IReadOnlyList(Of KeyValuePair(Of String, String))
属性值
例外
状态对象与支持的日志记录模型不兼容,并且不是只读列表。
注解
使用代码生成器日志记录模型进行日志记录时,提供给日志记录方法的参数将打包到单个状态对象中,该对象将 Log<TState>(LogLevel, EventId, TState, Exception, Func<TState,Exception,String>) 传递给 方法。 此状态可以作为一组在只读列表中编码的名称/值对进行检索。
此属性返回的对象与 State 返回的对象相同,只不过它已强制转换为只读列表。