title: Updating DB context to include a view model
body: <p>I'm using Entity Framework with MVC4. I'm not sure how to add my ViewModel to my dbcontext. Is it as simple as declaring it in my DbContext? Basically I wish to use my view model in my controller and pass it to my view. I've run into many many problems trying to accomplish this.</p>
  
  <pre><code>namespace BagInventory.Models
  {
      using System;
      using System.Data.Entity;
      using System.Data.Entity.Infrastructure;
  
      public partial class FreshouseSalesEntities : DbContext
      {
          public FreshouseSalesEntities()
              : base("name=FreshouseSalesEntities")
          {
          }
  
          protected override void OnModelCreating(DbModelBuilder modelBuilder)
          {
              throw new UnintentionalCodeFirstException();
          }
  
          public DbSet&lt;Materials_Packer&gt; Materials_Packer { get; set; }
          public DbSet&lt;Materials_Product&gt; Materials_Product { get; set; }
          public DbSet&lt;Materials_PackerProduct&gt; Materials_PackerProduct { get; set; }
          public DbSet&lt;Materials_Vendor&gt; Materials_Vendor { get; set; }
          public DbSet&lt;Materials_Log&gt; Materials_Log { get; set; }
          //Below is my view model I wish to add to dbcontext
          public DbSet&lt;BigViewModel&gt; BigViewModel{get;set;}
  
  
      }
  }
  </code></pre>
  
  <p>is this the correct way of doing this?</p>