Class DataReaderEventData
- Namespace
- Microsoft.EntityFrameworkCore.Diagnostics
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
DiagnosticSource event payload for DataReaderClosing.
public class DataReaderEventData : DbContextEventData
- Inheritance
-
DataReaderEventData
- Derived
Remarks
See Logging, events, and diagnostics for more information and examples.
Constructors
DataReaderEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData, string>, DbCommand, DbDataReader, DbContext?, Guid, Guid, int, int, DateTimeOffset)
Constructs a DiagnosticSource event payload for DataReaderClosing.
public DataReaderEventData(EventDefinitionBase eventDefinition, Func<EventDefinitionBase, EventData, string> messageGenerator, DbCommand command, DbDataReader dataReader, DbContext? context, Guid commandId, Guid connectionId, int recordsAffected, int readCount, DateTimeOffset startTime)
Parameters
eventDefinitionEventDefinitionBaseThe event definition.
messageGeneratorFunc<EventDefinitionBase, EventData, string>A delegate that generates a log message for this event.
commandDbCommandThe DbCommand that created the reader.
dataReaderDbDataReaderThe DbDataReader that is being disposed.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidA correlation ID that identifies the DbCommand instance being used.
connectionIdGuidA correlation ID that identifies the DbConnection instance being used.
recordsAffectedintGets the number of rows changed, inserted, or deleted by execution of the SQL statement.
readCountintGets the number of read operations performed by this reader.
startTimeDateTimeOffsetThe start time of this event.
Properties
Command
The DbCommand that created the reader.
public virtual DbCommand Command { get; }
Property Value
CommandId
A correlation ID that identifies the DbCommand instance being used.
public virtual Guid CommandId { get; }
Property Value
ConnectionId
A correlation ID that identifies the DbConnection instance being used.
public virtual Guid ConnectionId { get; }
Property Value
DataReader
The DbDataReader that is being disposed.
public virtual DbDataReader DataReader { get; }
Property Value
ReadCount
Gets the number of read operations performed by this reader.
public virtual int ReadCount { get; }
Property Value
RecordsAffected
Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.
public virtual int RecordsAffected { get; }
Property Value
StartTime
The start time of this event.
public virtual DateTimeOffset StartTime { get; }