You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add TryEachInContextAsync — a best-effort batch runner that continues processing remaining items when individual ones fail, collecting errors instead of aborting the whole batch.
Goal
Support partial success: keep 995 of 1000 emails when 5 fail, reporting failures at the end rather than halting.
Problem
ExecuteAll/Map propagates the first exception and abandons the rest. For bulk writes/notifications, a single bad address should not discard the remaining legitimate items.
Scope
TryEachInContextAsync returning a result object.
result record: SuccessCount, FailureCount, HasErrors, Failures ({Item, Exception}).
Each item runs in a context snapshot; exceptions per item are caught and collected.
Optional CancellationToken to abort between items.
Unit tests: mixed success/failure scenarios.
Design Expectations
Per-item isolation and events identical to base execution.
Failures are structural (exception) not state-corrupting.
Pairs naturally with MapParallel for bounded best-effort batches.
Acceptance Criteria
Returns counts and failure list instead of throwing on first item.
Activity