Class DataChangeEvent
Represents a data change event in a database table, including details about the change type, affected table, and data changes.
public sealed class DataChangeEvent
- Inheritance
-
DataChangeEvent
- Inherited Members
- Extension Methods
Properties
ChangeType
Gets the type of the data change (e.g., Insert, Update, Delete).
public DataChangeType ChangeType { get; init; }
Property Value
- DataChangeType
The type of the data change (e.g., Insert, Update, Delete).
Changes
Gets the collection of individual data changes for the affected table row.
public IList<DataChange> Changes { get; init; }
Property Value
- IList<DataChange>
The collection of individual data changes for the affected table row.
CommitTime
Gets the commit time of the transaction.
public DateTime CommitTime { get; init; }
Property Value
- DateTime
The commit time of the transaction.
Lsn
Gets the log sequence number (LSN) associated with the change event.
public byte[] Lsn { get; init; }
Property Value
- byte[]
The log sequence number (LSN) associated with the change event.
SeqVal
Gets the log sequence value associated with the change event.
public byte[] SeqVal { get; init; }
Property Value
- byte[]
The log sequence value associated with the change event.
TableName
Gets the name of the table where the change occurred.
public string TableName { get; init; }
Property Value
- string
The name of the table where the change occurred.
Methods
CreateDeleteEvent(CdcRow)
Creates a DataChangeEvent for a delete operation.
public static DataChangeEvent CreateDeleteEvent(CdcRow change)
Parameters
changeCdcRowThe CDC row representing the delete operation.
Returns
- DataChangeEvent
A DataChangeEvent representing the delete operation.
Exceptions
- ArgumentNullException
Thrown if
changeis null.
CreateInsertEvent(CdcRow)
Creates a DataChangeEvent for an insert operation.
public static DataChangeEvent CreateInsertEvent(CdcRow change)
Parameters
changeCdcRowThe CDC row representing the insert operation.
Returns
- DataChangeEvent
A DataChangeEvent representing the insert operation.
Exceptions
- ArgumentNullException
Thrown if
changeis null.
CreateUpdateEvent(CdcRow, CdcRow)
Creates a DataChangeEvent for an update operation.
public static DataChangeEvent CreateUpdateEvent(CdcRow beforeChange, CdcRow afterChange)
Parameters
beforeChangeCdcRowThe CDC row representing the state before the update.
afterChangeCdcRowThe CDC row representing the state after the update.
Returns
- DataChangeEvent
A DataChangeEvent representing the update operation.
Exceptions
- ArgumentNullException
Thrown if either
beforeChangeorafterChangeis null.