Hey David,
No, I don't want this behavior in all entities.
To really simplify, which is often good:
I have an entity called ItnEntity. It has three properties:
- ItnId - int
- Itn - string
- User - string
When an ItnEntity comes from the client with an Itn and User, but no ItnId, I have to check to see if that Itn already exists in the db.
If it doesn't, the record should just be inserted.
If it does, the existing record should be updated and the ItnEntity should be returned to the client with the existing ItnId, as if it had been an update.
So, I always check the in OnSave() to see if the Itn exists. At the moment, delete the existing record and then do an insert. However, this is not ideal. This should really become an update.
The rest of the entities in my system do not have this behavior.
Best,
Philip