AggregateWhile<TAccumulate> Method (IFilteredRecordCollection<TRecord>)
- Last UpdatedApr 08, 2026
- 1 minute read
Applies an accumulator function over all TRecord records by ascending IRecord.RecordNumber. The specified seed value is used as the initial accumulator value. If at any point the function returns OASySDNA.Common.Optional<TValue>.None, the aggregation stops, the accumulated value from the previous iteration is returned, and no further records are locked.
TAccumulate AggregateWhile<TAccumulate>(
TAccumulate seed,
Func<TAccumulate,TRecord,Optional<TAccumulate>> function,
LockType tableLockType,
LockType recordLockType
)
TAccumulate^ AggregateWhilegeneric<typename TAccumulate>
(
TAccumulate^ seed,
Func<TAccumulate^,TRecord^,Optional<TAccumulate^>>^ function,
LockType tableLockType,
LockType recordLockType
)
Parameters
- seed
- The initial accumulator value.
- function
- An accumulator function to be invoked on each element.
Return Some(TAccumulate) to include the value in the aggregation and to continue onto the next record.
Return OASySDNA.Common.Optional<TValue>.None to end the aggregation and return the previous iteration's value as the final result. - tableLockType
- The TRecord table lock type for the scope of the entire aggregation.
- recordLockType
- The TRecord record lock type for the scope of evaluating the function on each record.
Type Parameters
- TAccumulate
- The type of the accumulator value.
Return Value
The final accumulator value.