Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Where I work it has been decided that we are going to use rest services to return data to clients. Currently this is just .NET Clients (WPF and ASP.NET) but in the future could be anything a 3rd party wishes to use.

The issue being thrown about is how you handle change tracking of the data. So you make a call to get an employee entity (which may have many children) change one piece of data and call an update method on the service passing the changed entity. How does the service know what has changed to perform the update? Current thinking is you either update all records related to the model or provide a property on the entity for 'change status' and let the client be responsible for notifying what object has changed. Neither of which seems the ideal solution.

Surely someone else has solved this issue before us....

more info:

For example if you have an employee object returned which has lots of 'SalaryPayments', if one of the salary payments was changed I would not want to update all of them.
Posted
Updated 26-Jan-15 4:34am
v2

1 solution

Why would the service need to know what has changed? Give an example of what you're thinking here.

It normally just writes the entire record back to the database without having a clue about what changed. It assumes everything has changed, except the record ID of course.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900