How to insert record using viewmodels : Asp.Net Mvc
<p><strong>Introduction</strong></p>

<p>I am working with the mvc project, implementation approach is code-first.
Domain Model i am using, have more than 70 fields.So i made ViewModels.</p>

<p>Need for making view model is due to creating form wizard which store information in server side(Session Variable).</p>

<p><strong>Domain Model</strong></p>

<pre><code>public class RegisterationDM
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Key]
        public int RegisterationId { get; set; }
//other fields
}
</code></pre>

<p><strong>Main View Model</strong></p>

<pre><code>public class RegistrationViewModel
{
        public PersonalViewModel PersonalViewModel {get;set; }
        public DetailViewmodel DetailedViewmodel { get; set; }
        public PhysicalDetailViewModel PhysicalDetailViewModel { get; set; }
        public RequirementViewModel RequirementViewModel { get; set; }
        public CreationInfoViewModel CreationInfoViewModel { get; set; }
}
</code></pre>

<p><strong>Separate Classes</strong></p>

<pre><code>public class PersonalViewModel()
{
//fields
}
public class DetailViewmodel()
{
//fields
}
public class PhysicalDetailViewModel()
{
//fields
}
public class RequirementViewModel()
{
fields
}
public class CreationInfoViewModel()
{
//fields
}
</code></pre>

<p><strong>Record Insertion Code</strong></p>

<pre><code>public ActionResult SaveInformation()
        {
            RegisterationDM regdm = new RegisterationDM();
            RegistrationViewModel regvm = new RegistrationViewModel();

            PersonalViewModel personalvm = (PersonalViewModel)Session["Personal"];
            DetailViewmodel detailvm = (DetailViewmodel)Session["Detail"];
            PhysicalDetailViewModel physicalvm = (PhysicalDetailViewModel)Session["Physical"];
            RequirementViewModel requirementvm = (RequirementViewModel)Session["Requirement"];

            CreationInfoViewModel createdinforvm = new CreationInfoViewModel();
            createdinforvm.CreatedBy = "";
            createdinforvm.CreatedDate = DateTime.Now;

            regvm.PersonalViewModel = personalvm;
            regvm.DetailedViewmodel = detailvm;
            regvm.PhysicalDetailViewModel = physicalvm;
            regvm.RequirementViewModel = requirementvm;
            regvm.CreationInfoViewModel = createdinforvm;
            //here assigning of view model to domain model
            db.Reg.Add(regdm);
            db.SaveChanges();
            return View();
        }
</code></pre>

<p><strong>All Actions(Updated)</strong></p>

<pre><code>public ActionResult Step1()
        {
            RegistrationViewModel regvm = new RegistrationViewModel();
            return View(regvm.PersonalViewModel);
        }
        [HttpPost]
        public ActionResult Step1(PersonalViewModel personalvm)
        {
            if (ModelState.IsValid)
            {
                //Store the wizard in session
                Session["Personal"] = personalvm;
                return RedirectToAction("Step2");
            }
            else
            { 
            return View(personalvm);
            }
        }

        public ActionResult Step2()
        {
            if (Session["Personal"] != null)
            {
                RegistrationViewModel regvm = new RegistrationViewModel();
                return View(regvm.DetailedViewmodel);
            }
            else
            {
                return RedirectToAction("Step1");
            }
        }
        [HttpPost]
        public ActionResult Step2(DetailViewmodel detailvm)
        {
            if (ModelState.IsValid)
            {
                //Store the wizard in session
                Session["Detail"] = detailvm;
                return RedirectToAction("Step3");
            }
            return View(detailvm);
        }

        public ActionResult Step3()
        {
            if (Session["Detail"] != null &amp;&amp; Session["Personal"] != null)
            {
                RegistrationViewModel regvm = new RegistrationViewModel();
                return View(regvm.PhysicalDetailViewModel);
            }
            else
            {
                return RedirectToAction("Step1");
            }
        }
        [HttpPost]
        public ActionResult Step3(PhysicalDetailViewModel physicalsvm)
        {
            if (ModelState.IsValid)
            {
                //Store the wizard in session
                Session["Physical"] = physicalsvm;
                return RedirectToAction("Step4");
            }
            return View(physicalsvm);
        }

        public ActionResult Step4()
        {
            if (Session["Detail"] != null &amp;&amp; Session["Personal"] != null &amp;&amp; Session["Physical"] != null)
            {
                RegistrationViewModel regvm = new RegistrationViewModel();
                return View(regvm.RequirementViewModel);
            }
            else
            {
                return RedirectToAction("Step1");
            }
        }
        [HttpPost]
        public ActionResult Step4(RequirementViewModel requirementvm)
        {
            if (ModelState.IsValid)
            {
                Session["Requirement"] = requirementvm;
                return RedirectToAction("SaveInformation");
            }
            return View(requirementvm);
        }
</code></pre>

<p><strong>Question</strong></p>

<p>How can i add(record) using main view model.Should i map first?</p>

<p>I understand its not possible like that.So i ask, is there a proper way of doing that.What it might be?The best way, the right way or the wrong way?
I will prefer standard implementation even if it is hard to implement.</p>

<p>If someone have ideas about this problem, please do help.Any kind of help or reference will be appreciated.Thanks for your time.</p>

<p>(Due to lack of knowledge, may be i made some mistakes.Down Voters are welcome but please leave comment so i can improve question.)</p>