The Cdc
object enables the definition of the primary table, one-or-more child tables and their relationships, to enable Change Data Capture (CDC) event publishing. The IncludeColumns
and ExcludeColumns
provide a shorthand to include or exclude selected columns; with the AliasColumns
providing a means to rename where required.
A YAML configuration example is as follows:
The Cdc
object supports a number of properties that control the generated code output. These properties are separated into a series of logical categories. The properties with a bold name are those that are more typically used (considered more important).
Category | Description |
---|---|
Key |
Provides the key configuration. |
Columns |
Provides the Columns configuration. |
Database |
Provides the database configuration. |
DotNet |
Provides the .NET configuration. |
Infer |
Provides the special Column Name inference configuration. |
IdentifierMapping |
Provides the identifier mapping configuration. |
Collections |
Provides related child (hierarchical) configuration. |
Provides the key configuration.
Property | Description |
---|---|
name |
The name of the primary table. |
schema |
The default schema name used where not otherwise explicitly specified. Defaults to CodeGeneration.Schema . |
alias |
The Schema.Table alias name. Will automatically default where not specified. |
Provides the Columns configuration.
Property | Description |
---|---|
includeColumns |
The list of Column names to be included in the underlying generated output. Where not specified this indicates that all Columns are to be included. |
excludeColumns |
The list of Column names to be excluded from the underlying generated output. Where not specified this indicates no Columns are to be excluded. |
aliasColumns |
The list of Column and Alias pairs (split by a ^ lookup character) to enable column aliasing/renaming. Each alias value should be formatted as Column + ^ + Alias ; e.g. PCODE^ProductCode . |
Provides the database configuration.
Property | Description |
---|---|
executeStoredProcedureName |
The CDC execute outbox stored procedure name. Defaults to spExecute (literal) + Name + CdcOutbox (literal); e.g. spExecuteTableNameCdcOutbox . |
completeStoredProcedureName |
The CDC complete outbox stored procedure name. Defaults to spComplete (literal) + Name + CdcOutbox (literal); e.g. spCompleteTableNameCdcOutbox . |
cdcSchema |
The schema name for the generated CDC -related database artefacts. Defaults to CodeGeneration.CdcSchema . |
outboxTableName |
The corresponding CDC Outbox table name. Defaults to Name + Outbox (literal). |
Provides the .NET configuration.
Property | Description |
---|---|
modelName |
The .NET model name. Defaults to Name . |
dataConstructor |
The access modifier for the generated CDC Data constructor. Valid options are: Public , Private , Protected . Defaults to Public . |
databaseName |
The .NET database interface name. Defaults to IDatabase . |
eventSubject |
The Event Subject. Defaults to ModelName . Note: when used in code-generation the CodeGeneration.EventSubjectRoot will be prepended where specified. |
includeColumnsOnDelete |
The list of Column names that should be included (in addition to the primary key) for a logical delete. Where a column is not specified in this list its corresponding .NET property will be automatically cleared by the CdcDataOrchestrator as the data is technically considered as non-existing. |
excludeHostedService |
The option to exclude the generation of the CdcHostedService (background) class (XxxHostedService.cs ). |
excludeColumnsFromETag |
The list of Column names that should be excluded from the generated ETag (used for the likes of duplicate send tracking). Defaults to CodeGeneration.CdcExcludeColumnsFromETag . |
Provides the special Column Name inference configuration.
Property | Description |
---|---|
columnNameIsDeleted |
The column name for the IsDeleted capability. Defaults to CodeGeneration.IsDeleted . |
Provides the identifier mapping configuration.
Property | Description |
---|---|
identifierMapping |
Indicates whether to perform Identifier Mapping (mapping to GlobalId ) for the primary key. This indicates whether to create a new GlobalId property on the entity to house the global mapping identifier to be the reference outside of the specific database realm as a replacement to the existing primary key column(s). |
identifierMappingColumns |
The list of Column with related Schema /Table values (all split by a ^ lookup character) to enable column one-to-one identifier mapping. Each value is formatted as Column + ^ + Schema + ^ + Table where the schema is optional; e.g. ContactId^dbo^Contact or ContactId^Contact . |
Provides related child (hierarchical) configuration.
Property | Description |
---|---|
joins |
The corresponding CdcJoin collection. A Join object provides the configuration for a joining table. |
Note: This markdown file is generated; any changes will be lost.