Driver: Part or ViewModel?

Topics: Writing modules
Sep 3, 2013 at 11:38 AM
Looking at the modules included in the sources of Orchard I have seen that in some cases the driver of a ContentPart uses, as a model, the Part in some cases the ViewModel.
What is the correct way? The Part or the ViewModel?
Sep 3, 2013 at 3:23 PM
You mean in the Edit method, right? Both are correct. You have a choice.
Sep 4, 2013 at 1:03 AM
Edited Sep 4, 2013 at 1:03 AM
Depends on the scenario actually.
You may want to have an editor form that does not directly map to your content part. In this case using a view model as an intermediate data carrier is what you want.
Sep 4, 2013 at 6:49 AM
Thanks for the replies.
Therefore, there isn't a method "a little 'better" than the other :)
You can choose according to situations

PS: Sorry for my bad English