I have a structure that looks
ID int Name nvarchar
ID int PersonId int Number nvarchar Make nvarchar Model nvarchar DualSim Bit
One person can have multiple phones
For the moment, the logic that I have is that each time the user clicks the Save button, the application receives a copy of the Person object (which includes a phone array) .
As mentioned, the relationship is 1 to many. As such, when backing up, there is only one person and so it is easy to update the person (no need to delete or add again).
Currently, I delete all the phones associated with the person and add them.
The negative that I can see is:
- It takes more time, because you have to delete and then add each phone, whether there was an amendment or not.
- The phone's identifier, which increments automatically, becomes larger and larger each time this process occurs
I can not find anything to explain if my current approach is bad or not. Should I worry about the fact that the identifier is getting bigger? Should I somehow check the current phone objects with the ones I want to record?