DatabaseLogFormatter 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
DatabaseLogFormatter(Action<String>) |
建立不會依任何 DbContext 篩選的格式器,並改為記錄來自任何內容的每個命令,以及源自內容的命令。 |
DatabaseLogFormatter(DbContext, Action<String>) |
建立格式子,其只會記錄來自指定 DbContext 實例的命令。 |
DatabaseLogFormatter(Action<String>)
建立不會依任何 DbContext 篩選的格式器,並改為記錄來自任何內容的每個命令,以及源自內容的命令。
public DatabaseLogFormatter(Action<string> writeAction);
new System.Data.Entity.Infrastructure.Interception.DatabaseLogFormatter : Action<string> -> System.Data.Entity.Infrastructure.Interception.DatabaseLogFormatter
Public Sub New (writeAction As Action(Of String))
參數
備註
在 上 Log 設定委派時,不會使用此建構函式。 相反地,您可以直接使用 來設定格式器來使用它 Add(IDbInterceptor) 。
適用於
DatabaseLogFormatter(DbContext, Action<String>)
建立格式子,其只會記錄來自指定 DbContext 實例的命令。
public DatabaseLogFormatter(System.Data.Entity.DbContext context, Action<string> writeAction);
new System.Data.Entity.Infrastructure.Interception.DatabaseLogFormatter : System.Data.Entity.DbContext * Action<string> -> System.Data.Entity.Infrastructure.Interception.DatabaseLogFormatter
Public Sub New (context As DbContext, writeAction As Action(Of String))
參數
- context
- DbContext
應該記錄命令的內容。 傳遞 null 以記錄來自任何內容的每個命令,以及源自內容的命令。
備註
這個建構函式必須由繼承自這個類別的類別呼叫,才能覆寫 的行為 Log 。