So I am using ViewModels to pass data from/to the web forms in my MVC application, as seems to be recommended practice from what I have read.
My question is what is the normal approach to then map the ViewModel into an actual domain entity?
I'm guessing I should probably add a 'GetObject' method to my ViewModels so I have something like:
[AcceptVerbs(HttpVerbs.Post)]
public void CreatePerson(PersonViewModel model)
{
Person p = model.GetPerson();
_repository.Save(p);
}
Is this the right approach? It seems like I'm creating a lot of unecessary work for myself by using ViewModels in this way.