DatabaseLogFormatter Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
DatabaseLogFormatter(Action<String>) |
Creates a formatter that will not filter by any DbContext and will instead log every command from any context and also commands that do not originate from a context. |
DatabaseLogFormatter(DbContext, Action<String>) |
Creates a formatter that will only log commands the come from the given DbContext instance. |
DatabaseLogFormatter(Action<String>)
Creates a formatter that will not filter by any DbContext and will instead log every command from any context and also commands that do not originate from a context.
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))
Parameters
Remarks
This constructor is not used when a delegate is set on Log. Instead it can be used by setting the formatter directly using Add(IDbInterceptor).
Applies to
DatabaseLogFormatter(DbContext, Action<String>)
Creates a formatter that will only log commands the come from the given DbContext instance.
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))
Parameters
- context
- DbContext
The context for which commands should be logged. Pass null to log every command from any context and also commands that do not originate from a context.
Remarks
This constructor must be called by a class that inherits from this class to override the behavior of Log.
Applies to
Entity Framework