Skip to main content

BulkOperationProber

  • Namespace: PPDS.Migration.Import
  • Assembly: PPDS.Migration
  • Kind: Class

Summary

Probes entities to detect bulk operation support and executes appropriate strategy.

Members

Constructors

BulkOperationProber(IBulkOperationExecutor bulkExecutor, ILogger<BulkOperationProber> logger)

BulkOperationProber(IBulkOperationExecutor bulkExecutor, ILogger<BulkOperationProber> logger)

Initializes a new instance of the PPDS.Migration.Import.BulkOperationProber class.

  • Param bulkExecutor: The bulk operation executor.

  • Param logger: Optional logger.

Methods

ExecuteWithProbeAsync

Task<BulkOperationResult> ExecuteWithProbeAsync(string entityName, IReadOnlyList<Entity> records, BulkOperationType operationType, BulkOperationOptions options, DataverseClientOptions clientOptions, Func<string, IReadOnlyList<Entity>, Task<BulkOperationResult>> fallbackExecutor, IProgress<ProgressSnapshot> progress, CancellationToken cancellationToken)

Executes a bulk operation with probing to detect bulk support.

  • Param entityName: The entity logical name.

  • Param records: The records to process.

  • Param operationType: The type of bulk operation.

  • Param options: Bulk operation options.

  • Param clientOptions: Optional per-request connection options (e.g., CallerId for impersonation).

  • Param fallbackExecutor: Executor for individual operations when bulk isn't supported.

  • Param progress: Optional progress reporter.

  • Param cancellationToken: Cancellation token.

  • Returns: The combined result from probe and remaining records.

IsBulkNotSupportedFailure

bool IsBulkNotSupportedFailure(BulkOperationResult result, int totalRecords)

Determines if a bulk operation failure indicates the entity doesn't support bulk operations.

  • Param result: The bulk operation result.

  • Param totalRecords: The total number of records attempted.

  • Returns: True if the failure indicates bulk operations are not supported.

IsKnownBulkNotSupported

bool IsKnownBulkNotSupported(string entityName)

Gets whether an entity is known to not support bulk operations.

  • Param entityName: The entity logical name.

  • Returns: True if the entity is known to not support bulk operations.

MarkBulkNotSupported

void MarkBulkNotSupported(string entityName)

Marks an entity as not supporting bulk operations.

  • Param entityName: The entity logical name.

MergeBulkResults

BulkOperationResult MergeBulkResults(BulkOperationResult probeResult, BulkOperationResult remainingResult)

Merges two bulk operation results into one combined result. Used when probe record is processed separately from remaining records.

  • Param probeResult: The result from the probe operation (first record).

  • Param remainingResult: The result from processing remaining records.

  • Returns: A combined result with adjusted error indices.