This project is read-only.

SqlTableDependency Constructor

Creates a new instance of the SqlTableDependency class.

Syntax

public SqlTableDependency(
   string connectionString, 
   string tableName, 
   ModelToColumnsTableMapper mapper = null, 
   IEnumerable<string> columnsToMonitorDuringUpdate = null)

Parameters

connectionString
Type: System.String
SQL server connection string relative to the database containing the table to monitor.

tableName
Type: System.String
Database table name to monitor.

mapper
Type: ModelToTableMapper (Optional)
Used to specify a mapping between model properties and database table columns name.

columnsToMonitorDuringUpdate
Type: IEnumerable<string> (Optional)
Used to define a database table columns list to monitor during the record UPDATE. Defining this list, you will receive event only when the specified column has been changed. Is has effects only for UPDATE operations. Basically with this list, the table trigger will use the UPDATE(_tablecolumn_) condition. Example:

var tableDependency = new OracleTableDependency<Item>(
   _connectionString, 
   "Address", 
   columnsToMonitorDuringUpdate: new List<string>() { 
      "StateProvinceID", 
      "PostalCode" });

SqlTableDependency's generated trigger code:

CREATE TRIGGER reminder ON Address
AFTER UPDATE 
AS 
    IF ( UPDATE (StateProvinceID) OR UPDATE (PostalCode) )
    BEGIN
       ...
    END

Last edited Oct 10, 2016 at 1:42 PM by delbianco, version 21