I'm new to MVVM, I get the general idea, but there's one thing that I've been having a tough time finding an answer for.  Inevitably an application will have a save button in the UI.  The UI talks to the View Model, the view model updates the model objects, and then the model saves to whatever persistence medium (DB, File System, Web Service...).My questing is how does this last step happen?  Does the View Model get an instance of a DAL object? public MyVm(IMyModel obj, IDal<IMyModel> dal){ ... }Or does IMyModel have CRUD methods as part of its interface.Is it the third option, which is me getting this completely wrong?
MVVM Persistence from view model
mvvm;persistence
This is a simple explanation with code sample of how it is done in C#, persistence medium is the context object. View model is used mainly to update some properties of the model object, then during SaveOrUpdate operation persistence medium should check wether the model has been modified somewhere else and wether the model state is valid (foreign key constraints, value constraints and so on). If there are none - the storage gets updated