DbCommandLogData DbCommandLogData Class

Logging information about a System.Data.Common.DbCommand that is being executed.

Instances of this class are typically created by Entity Framework and passed to loggers, it is not designed to be directly constructed in your application code.

Syntax

Declaration

[Obsolete("This class is obsolete. It will be removed in a future release.")]
public class DbCommandLogData : IEnumerable<KeyValuePair<string, object>>, IEnumerable<Obsolete("This class is obsolete. It will be removed in a future release.")>
Public Class DbCommandLogData
    Implements IEnumerable(Of KeyValuePair(Of String, Object)), IEnumerable

Inheritance Hierarchy

  • System.Object
    System.Object
  • DbCommandLogData
    DbCommandLogData

Inherited Members

ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Constructors summary

Initializes a new instance of the DbParameterLogData class.

Properties summary

Gets the command text being executed.

Gets the timeout configured for the command.

Gets the type of command being executed.

Gets how many milliseconds the command took to execute (if it has completed).

Gets the parameters for the command.

Methods summary

Explicit Interface Implementations summary

Constructors

  • DbCommandLogData(String, CommandType, Int32, IReadOnlyList<DbParameterLogData>, Nullable<Int64>)
    DbCommandLogData(String, CommandType, Int32, IReadOnlyList(Of DbParameterLogData), Nullable(Of Int64))

    Initializes a new instance of the DbParameterLogData class.

    public DbCommandLogData(string commandText, CommandType commandType, int commandTimeout, IReadOnlyList<DbParameterLogData> parameters, long ? elapsedMilliseconds)Public Sub New(commandText As String, commandType As CommandType, commandTimeout As Integer, parameters As IReadOnlyList(Of DbParameterLogData), elapsedMilliseconds As Long?)

    Parameters

    • commandText
      System.String
      System.String

      The command text being executed.

    • commandType
      System.Data.CommandType
      System.Data.CommandType

      The type of command being executed.

    • commandTimeout
      System.Int32
      System.Int32

      The timeout configured for the command.

    • parameters
      System.Collections.Generic.IReadOnlyList<T><DbParameterLogData>
      System.Collections.Generic.IReadOnlyList<T>(Of DbParameterLogData)

      Parameters for the command.

    • elapsedMilliseconds
      System.Nullable<T><System.Int64>
      System.Nullable<T>(Of System.Int64)

      How many milliseconds the command took to execute (if it has completed).

Properties

  • CommandText
    CommandText

    Gets the command text being executed.

    public virtual string CommandText { get; }Public Overridable ReadOnly Property CommandText As String

    Property Value

    • System.String
      System.String
  • CommandTimeout
    CommandTimeout

    Gets the timeout configured for the command.

    public virtual int CommandTimeout { get; }Public Overridable ReadOnly Property CommandTimeout As Integer

    Property Value

    • System.Int32
      System.Int32
  • CommandType
    CommandType

    Gets the type of command being executed.

    public virtual CommandType CommandType { get; }Public Overridable ReadOnly Property CommandType As CommandType

    Property Value

    • System.Data.CommandType
      System.Data.CommandType
  • ElapsedMilliseconds
    ElapsedMilliseconds

    Gets how many milliseconds the command took to execute (if it has completed).

    public virtual long ? ElapsedMilliseconds { get; }Public Overridable ReadOnly Property ElapsedMilliseconds As Long?

    Property Value

    • System.Nullable<T><System.Int64>
      System.Nullable<T>(Of System.Int64)
  • Parameters
    Parameters

    Gets the parameters for the command.

    public virtual IReadOnlyList<DbParameterLogData> Parameters { get; }Public Overridable ReadOnly Property Parameters As IReadOnlyList(Of DbParameterLogData)

    Property Value

Methods

  • GetEnumerator()
    GetEnumerator()
    public virtual IEnumerator<KeyValuePair<string, object>> GetEnumerator()Public Overridable Function GetEnumerator As IEnumerator(Of KeyValuePair(Of String, Object))

    Returns

    • System.Collections.Generic.IEnumerator<T><System.Collections.Generic.KeyValuePair`2<System.String, System.Object>>
      System.Collections.Generic.IEnumerator<T>(Of System.Collections.Generic.KeyValuePair`2(Of System.String, System.Object))

Explicit Interface Implementations

  • IEnumerable.GetEnumerator()
    System.Collections.IEnumerable.GetEnumerator()
    IEnumerator IEnumerable.GetEnumerator()Function System.Collections.IEnumerable.GetEnumerator As IEnumerator Implements IEnumerable.GetEnumerator

    Returns

    • System.Collections.IEnumerator
      System.Collections.IEnumerator

Details

Assembly

Microsoft.EntityFrameworkCore.Relational.dll