次の方法で共有


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

適用対象