Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Breaking:
c-select-many-to-many
now only performs/save
and/delete
API calls if themodel
it is bound to is enabled for autosaves.Bulk Saves
Bulk saves save all changes to an object graph in one API call and one database transaction. This includes creation, updates, and deletions of entities.
To use bulk saves, you can work with your ViewModel instances on the client much in the same way you would on the server with Entity Framework. Assign objects to reference navigation properties and modify scalar values to perform creates and updates. To perform deletions, you must call
model.$remove()
on the ViewModel you want to remove, similar how you would callDbSet<>.Remove(model)
on the server.If the client-side Rules/Validation report any errors for any of the models being saved in the operation, an error will be thrown.
On the server, each affected entity is handled through the same standard mechanisms as are used by individual saves or deletes (Behaviors, Data Sources, and Security Attributes), but with a bit of sugar on top:
For the response to a bulk save, the server will load and return the root ViewModel that
$bulkSave
was called upon, using the instance's$params
object for the Standard Parameters.