I want to use XData to create a Rest/API that can be consumed by a .Net Core client.
And I want to use Aurelius to support my CRUD operations.
But, it is very important that I can handle a complete object-graph (entity with several child entity relationships) in one persist call (as a transaction).
My plan is to create all required entities, there relationships and set the correct persistent settings like cascading. On a GET call the complete entity, with all related entities are returned (json) and can be changed by the .Net Core client.
My question relates to the behavior of the persist call.
On the persist-call my service will deserialize the changed (complete) entity so Aurelius has all the information to flush the changes. This can result in sequence of creates, updates and deletes, because of the related child entities. Note, that child entities can be a reference or an embedded entity.
Reading the Aurelius documentation I belief this can work for Insert and Update, but I’m wondering how Aurelius will handle the deletion of relationships, because, the json information will not hold any state.
A Team-Entity has a list of Employees references and on persist some employees are added and some are deleted. Within that one persist call, how does Aurelius know which employee are removed from the team. The only solution I can think of is to reflect the current database records against the Team.Employees list and delete the difference.
Can you explain if this can work.
Thanks for you time.