title: ViewModel of 3 models in one view
body: <p>Hello am using MVC4 am trying to use viewmodel so that i can access to the data  of 3 model...</p>
  
  <p>I want to show list of following information:(Project Name , Supplier Name, Supplier answer)</p>
  
  <p>here my code:</p>
  
  <pre><code>public class Projects
  {
      [Key]
      public int ProjectId { get; set; }
      public string ProjectName { get; set; }
      public string Descriptions { get; set; }
  }
  
  public class SubmitedProjects
  {
      [Key]
      public int ProjectId { get; set; }
      public int SupplierId { get; set; }
      public string SupplierAnswerr { get; set; 
  }
  
  public class Supplier
  {
      [Key]
      public int SupplierId { get; set; }
      public string SupplierName { get; set; 
  }
  </code></pre>
  
  <p>My try of view model :</p>
  
  <pre><code>public class ModelInfo
    {
      public ProjectEntry oProjects { get; set; }
      public SubmittedProject oSubmitedProjects { get; set; }
  
    }
  </code></pre>
  
  <p>Controller : </p>
  
  <pre><code>    public ActionResult MProjects ( )
      {
  
         SubmittedProjectContext d = new SubmittedProjectContext();
         ProjectContext ds = new ProjectContext();
         List &lt;ModelInfo&gt; r = new List &lt;ModelInfo&gt;();
         ModelInfo rr = new ModelInfo();
  
           rr.oSubmitedProjects=new SubmittedProject();
           rr.oProjects=new Projects();
           r.Add(rr);
           return View(r);
      }
  </code></pre>