How do you handle the deletion of your model working with ViewModels and keeping them in sync ?
- by Lisa
Hello,
these could be my entity relations:
1 Pupil has 1 Chair
1 Pupil has N Documents
1 Pupil has N Marks
1 Pupil has N IncidentReports
etc...
So with that sample I get 4 IEnumerable from my database put each into an
ObservableCollection.
Now I have 4 different Views each bound to one of those 4 collections.
Lets assume I delete a single PupilViewModel in the AdministrationController which is the only View where I can delete a PupilViewModel.
Now I have to inform 3 other Controller and their ObservableCollections about the one deleted PupilViewModel to keep the whole application synchronized... thats stupid somehow.
Do you have any good advice on that scenario?
AND it gets even worse. If I delete a schoolclass I have to sync the pupils everywhere AND the documents or incidentreports or marks...
gush... o_O