Skip to content

this.FieldManager.UpdateChildren(...) vs await DataPortal.UpdateChildAsync(theChild, params) #1826

Discussion options

You must be logged in to vote

The default behavior should work correctly, but you don't have control.

In other words, UpdateChildren ultimately invokes each child's child update operation, and if that operation is async it will wait for the result. This means the operations will run in serial, and will work correctly within the context of a root async method.

If you want more control, such as updating multiple child objects in parallel, then you need to loop through the children and use DataPortal.UpdateChildAsync, as this does not call Wait and instead returns a Task so you can execute the operations in parallel or await them individually, or whatever you choose.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by skeeler88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants