public CdcTransactionClient(string connectionString, string stateManagementConnectionString, ICdcRepository cdcRepository = null, ITableSchemaRepository tableSchemaRepository = null, IFullLoadRepository fullLoadRepository = null, IStateManager stateManager = null, ITransactionCoordinator transactionCoordinator = null) { if (cdcRepository == null) { _cdcRepository = new CdcRepository(connectionString); } else { _cdcRepository = cdcRepository; } if (tableSchemaRepository == null) { _tableSchemaRepository = new TableSchemaRepository(connectionString); } else { _tableSchemaRepository = tableSchemaRepository; } if (fullLoadRepository == null) { _fullLoadRepository = new FullLoadRepository(connectionString); } else { _fullLoadRepository = fullLoadRepository; } if (stateManager == null) { _stateManager = new StateManager(stateManagementConnectionString); } else { _stateManager = stateManager; } if (transactionCoordinator == null) { _transactionCoordinator = new TransactionCoordinator(_cdcRepository); } else { _transactionCoordinator = transactionCoordinator; } }
public SchedulingService( ISchedulingRepository schedulingRepository , IProgramRepository programRepository , ICustomerRepository customerRepository , ICdcRepository cdcRepository , ILog loggingInstance, LoggingCommandHandlerDecorator <LogCommand> loghandler ) { _schedulingRepository = schedulingRepository ?? throw new ArgumentNullException($"schedulingRepository repository instance is null"); _programRepository = programRepository ?? throw new ArgumentNullException($"programRepository repository instance is null"); _customerRepository = customerRepository ?? throw new ArgumentNullException($"customerRepository repository instance is null"); _cdcRepository = cdcRepository ?? throw new ArgumentNullException($"cdcRepository repository instance is null"); _loggingInstance = loggingInstance ?? throw new ArgumentNullException($"logging instance is null"); _logHandler = loghandler ?? throw new ArgumentNullException($"logging commandhandlerDecorator instance is null"); }
public LeadService( ILeadRepository leadRepository , IERMSRepository ermsRepository , IContactRepository contactRepository , IAddressRepository addressRepository , IUsageRepository usageRepository , IProgramRepository programRepository , ICustomerRepository customerRepository , ICdcRepository cdcRepository , ILog loggingInstance, LoggingCommandHandlerDecorator <LogCommand> loghandler ) { _leadRepository = leadRepository ?? throw new ArgumentNullException($"lead repository instance is null"); _contactRepository = contactRepository ?? throw new ArgumentNullException($"ContactRepository repository instance is null"); _ermsRepository = ermsRepository ?? throw new ArgumentNullException($"ermsRepository repository instance is null"); _addressRepository = addressRepository ?? throw new ArgumentNullException($"AddressRepository repository instance is null"); _usageRepository = usageRepository ?? throw new ArgumentNullException($"UsageRepository repository instance is null"); _customerRepository = customerRepository ?? throw new ArgumentNullException($"customerRepository repository instance is null"); _cdcRepository = cdcRepository ?? throw new ArgumentNullException($"cdcRepository instance is null"); _programRepository = programRepository ?? throw new ArgumentNullException($"programRepository repository instance is null"); _loggingInstance = loggingInstance ?? throw new ArgumentNullException($"logging instance is null"); _logHandler = loghandler ?? throw new ArgumentNullException($"logging commandhandlerDecorator instance is null"); }
public TransactionCoordinator(ICdcRepository cdcRepository) { _cdcRepository = cdcRepository; _tableReaderTasks = new List <Task>(); }
public static async Task <GenericServiceResponse> InsertAuditRecordAsync(LogCommand logCommand, PayloadParent payload, string objectFullName, string lastModifiedBy, ICdcRepository auditRepository) { var response = new GenericServiceResponse(); var cdcAuditEntity = new CdcAuditEntity { AuditLogGuid = Guid.NewGuid(), CreatedById = payload.CreatedById, CreatedDate = payload.CreatedDate, EventType = payload.EventTypeC, ObjectType = objectFullName, LastModifiedById = lastModifiedBy, LastModifiedDate = DateTime.Now, RecordId = payload.RecordIdC, }; var auditResponse = await auditRepository.InsertAuditRecord(cdcAuditEntity, logCommand); if (auditResponse == 1) { response.Success = true; } return(response); }