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 回傳的物件相同,只是被鑄造成唯讀清單。