I am working on the back end of a REST API -
For a POST request (in one of the scenarios) I need to validate if the object sent by the user is the same as the one stored in the Db.
What is an efficient way of comparing two objects in C#?
PS - I want the comparison logic to withstand the test of time, i.e. being a huge team I do not rely on people adding new fields in the IComparable logic. Anyone can add a new property to the object and that would skip the validation test if they do not add that to the comparison logic.
I am thinking of Deserializing the object stored in our database and compare it to the deserialized version of that the user POSTS.
Any thoughts?