DatabaseLogFormatter Constructors

Definition

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

writeAction
Action<String>

The delegate to which output will be sent.

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.

writeAction
Action<String>

The delegate to which output will be sent.

Remarks

This constructor must be called by a class that inherits from this class to override the behavior of Log.

Applies to