I did not understand in the previous topic, but apparently no one is going to answer me anymore, so I’ll open a new one. Same question: is the service contract Model or ViewModel ??? It is important that in the service contract there is data that are bound to the presentation. For example, the same list of customers. No one except the service contract will be able to update them, which means it’s like a ViewModel. But in the previous topic I was assured that this is a Model ... So what is it ??? I do not want to start learning MVVM with the wrong interpretation. It's just that I immediately try to apply the pattern to one of my real projects, which draws something ...

  • And you, sorry for the stupid question, are you planning to display the contract itself? - Monk
  • @Monk I kind of described in detail what I plan to display ... The list of clients, in particular. There are some other data that only the server also updates. - PECHAPTER
  • You want to save entities, so you have confusion. The client must have a view model for display. And she just has to use the services (and their contracts, yeah) to work with the server. The services themselves are neither models nor view models. - Monk
  • @Monk I don't want to save anything. I want to do as correctly. You tell me how you offer to update data that only the service can update? No one except the service will be able to update them. Absolutely no one! - PECHAPTER
  • Then, in my opinion, you have problems with architecture. With which re-run, nobody can update the data? Why can not call the service to update? - Monk

1 answer 1

In short, this is a model. A model in MVVM is all the logic that relates to the data, what you take, how you take it and what you are doing with this model, and what's inside you (WCF, EF, WebApi) is no longer important. The view model contains only the logic for displaying data in the view and does not need to know anything about what technology you have behind the model (WCF, EF, WebApi)

  • one
    Very well formulated, by the way. - VladD