You can write a Model and all of its relationships in a single
request. Keep in mind normal dirty tracking rules still apply - nothing
is sent to the server unless it is dirty.
Typescript
Javascript
Use model.isMarkedForDestruction = true to delete the associated
object. Use model.isMarkedForDisassociation = true to remove the association
without deleting the underlying object:
Typescript
Javascript
You may want to send only the id of the related object to the server - ensuring the models are associated without updating attributes by
accident. Just add .id to the relationship name: