Clear grid pending-change collections¶
Reset a grid's pending add/delete/update collections after a successful save while preserving displayed rows. Trigger: Controller resetting a grid after a successful save*.
| Field | Value |
|---|---|
| Operation ID | OP-28 |
| Trigger | Controller resetting a grid after a successful save* |
| Inputs | GridViewModel<T> |
| Outputs | Added, Deleted, and Updated replaced with empty lists |
| Primary components | GridRowViewModelExtensions.ClearAll<T>(GridViewModel<T>) |
| Entry point | src/Web.Mvc/ViewModels/GridRowViewModel.cs |
Steps¶
- Assign new empty
List<T>instances toAdded,Deleted, andUpdated.Rowsis deliberately left intact (BR-64).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Controller calls ClearAll])
Clear["Reset Added, Deleted, Updated to empty lists"]
EndOk(["Rows preserved, pending collections cleared"])
Start --> Clear
Clear --> EndOk
Failure and edge-case behavior¶
- No unexpected failure paths beyond argument-guard exceptions and delegated dependency behavior were identified for this operation.
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with**could not be confirmed; treat as unknown until verified.
Sources¶
src/Web.Mvc/ViewModels/GridRowViewModel.cs