public async Task LinkIdentifierMappingsAsync(CdcValueIdentifierMappingCollection coll, IStringIdentifierGenerator idGen) { coll.AddAsync(GlobalId == default, async() => new CdcValueIdentifierMapping { Value = this, Property = nameof(GlobalId), Schema = "Legacy", Table = "Address", Key = this.CreateIdentifierMappingKey(), GlobalId = await idGen.GenerateIdentifierAsync <AddressCdc>().ConfigureAwait(false) }); coll.AddAsync(GlobalAlternateAddressId == default && AlternateAddressId != default, async() => new CdcValueIdentifierMapping { Value = this, Property = nameof(GlobalAlternateAddressId), Schema = "Legacy", Table = "Address", Key = AlternateAddressId.ToString(), GlobalId = await idGen.GenerateIdentifierAsync <AddressCdc>().ConfigureAwait(false) }); }
/// <summary> /// Initializes a new instance of the <see cref="CdcDataOrchestrator{TCdcEntity, TCdcEntityWrapper, TCdcEntityWrapperColl, TCdcTrackingMapper}"/> class that requires identifier mapping support. /// </summary> /// <param name="db">The <see cref="IDatabase"/>.</param> /// <param name="executeStoredProcedureName">The name of the execute outbox stored procedure.</param> /// <param name="completeStoredProcedureName">The name of the complete outbox stored procedure.</param> /// <param name="eventPublisher">The <see cref="IEventPublisher"/>.</param> /// <param name="logger">The <see cref="ILogger"/>.</param> /// <param name="identifierMappingStoredProcedureName">The name of the optional identifier mapping stored procedure.</param> /// <param name="identifierGenerator">The <see cref="IStringIdentifierGenerator"/>.</param> /// <param name="identifierMappingTvp">The <see cref="IIdentifierMappingTvp"/>.</param> public CdcDataOrchestrator(IDatabase db, string executeStoredProcedureName, string completeStoredProcedureName, IEventPublisher eventPublisher, ILogger logger, string identifierMappingStoredProcedureName, IStringIdentifierGenerator identifierGenerator, IIdentifierMappingTvp identifierMappingTvp) : this(db, executeStoredProcedureName, completeStoredProcedureName, eventPublisher, logger) { IdentifierMappingStoredProcedureName = Check.NotEmpty(identifierMappingStoredProcedureName, nameof(identifierMappingStoredProcedureName)); IdentifierGenerator = Check.NotNull(identifierGenerator, nameof(identifierGenerator)); IdentifierMappingTvp = Check.NotNull(identifierMappingTvp, nameof(identifierMappingTvp)); }
public async Task LinkIdentifierMappingsAsync(CdcValueIdentifierMappingCollection coll, IStringIdentifierGenerator idGen) { }
public ContactCdcData(IDatabase db, IEventPublisher evtPub, ILogger <ContactCdcData> logger, IStringIdentifierGenerator idGen) : base(db, "[DemoCdc].[spExecuteContactCdcOutbox]", "[DemoCdc].[spCompleteContactCdcOutbox]", evtPub, logger, "[DemoCdc].[spCreateCdcIdentifierMapping]", idGen, new CdcIdentifierMappingDbMapper()) => ContactCdcDataCtor();
public async Task LinkIdentifierMappingsAsync(CdcValueIdentifierMappingCollection coll, IStringIdentifierGenerator idGen) { coll.AddAsync(GlobalId == default, async() => new CdcValueIdentifierMapping { Value = this, Property = nameof(GlobalId), Schema = "Legacy", Table = "Person", Key = this.CreateIdentifierMappingKey(), GlobalId = await idGen.GenerateIdentifierAsync <PersonCdc>().ConfigureAwait(false) }); Addresses?.ForEach(async item => await item.LinkIdentifierMappingsAsync(coll, idGen).ConfigureAwait(false)); }