Invoked before applying the parsed table update (delta) to this table. This is called for all tables before any updates are applied, allowing OnBeforeDelete callbacks to be triggered for rows that will be removed. Calling the OnBeforeDelete callbacks allows the user to read the old values of the rows that will be removed, before they are actually removed. Should be called before Apply an
(IEventContext context, IParsedTableUpdate parsedTableUpdate)
| 430 | /// Should be called before Apply and PostApply. |
| 431 | /// </summary> |
| 432 | void IRemoteTableHandle.PreApply(IEventContext context, IParsedTableUpdate parsedTableUpdate) |
| 433 | { |
| 434 | Debug.Assert(wasInserted.Count == 0 && wasUpdated.Count == 0 && wasRemoved.Count == 0, "Call Apply and PostApply before calling PreApply again"); |
| 435 | if (IsEventTable) return; // Event tables have no deletes. |
| 436 | var delta = (ParsedTableUpdate)parsedTableUpdate; |
| 437 | foreach (var (_, value) in Entries.WillRemove(delta.Delta)) |
| 438 | { |
| 439 | InvokeBeforeDelete(context, value); |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | /// <summary> |
| 444 | /// Applies the parsed table update (delta) to this table. |
nothing calls this directly
no test coverage detected