/// <summary> /// Add changes to batch info. /// </summary> public async Task AddChangesAsync(SyncSet changes, int batchIndex = 0, bool isLastBatch = true, BaseOrchestrator orchestrator = null) { if (this.InMemory) { this.InMemoryData = changes; } else { var bpId = this.GenerateNewFileName(batchIndex.ToString()); //var fileName = Path.Combine(this.GetDirectoryFullPath(), bpId); var bpi = await BatchPartInfo.CreateBatchPartInfoAsync(batchIndex, changes, bpId, GetDirectoryFullPath(), isLastBatch, orchestrator).ConfigureAwait(false); // add the batchpartinfo tp the current batchinfo this.BatchPartsInfo.Add(bpi); } }
/// <summary> /// Add changes to batch info. /// </summary> public async Task AddChangesAsync(SyncSet changes, int batchIndex = 0, bool isLastBatch = true, ISerializerFactory serializerFactory = default, BaseOrchestrator orchestrator = null) { if (this.InMemory) { this.SerializerFactoryKey = null; this.InMemoryData = changes; } else { this.SerializerFactoryKey = serializerFactory.Key; var bpId = GenerateNewFileName(batchIndex.ToString()); var bpi = await BatchPartInfo.CreateBatchPartInfoAsync(batchIndex, changes, bpId, GetDirectoryFullPath(), isLastBatch, serializerFactory, orchestrator).ConfigureAwait(false); // add the batchpartinfo tp the current batchinfo this.BatchPartsInfo.Add(bpi); } }