共用方式為


FakeLogRecord.StructuredState 屬性

定義

取得呼叫端在建立記錄檔記錄做為唯讀清單時所提供的不透明狀態。

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 ,但已轉換成隻讀清單。

適用於