title: Mixing Model first and Code first
body: <p>We created a web application using the model first approach. A new developer came into the project and created a new custom model using the code first approach (using a database file). The</p>
  
  <p>Here is the code first database context.</p>
  
  <pre><code>namespace WVITDB.DAL
  {
  public class DashboardContext : DbContext
  {
      public DbSet&lt;CTOReview&gt; CTOReviews { get; set; }
      public DbSet&lt;Concept&gt; Concepts { get; set; }
  
      //public DashboardContext()
      //    : base("name=DashboardContext")
      //{
  
      //}
  
  
    //  protected override void OnModelCreating(DbModelBuilder modelBuilder)
     // {
     //     //modelBuilder.Conventions.Remove&lt;PluralizingTableNameConvention&gt;();
     // }
  }
  }
  </code></pre>
  
  <p>The following controller method throws an error <code>Could not find the conceptual model type for 'WVITDB.Models.FavoriteProject'.</code> and refers to the original database model. We are not sure why (or how) it is calling that. </p>
  
  <pre><code>  public ViewResult Index()
          {
              var d = db.Concepts.ToList(); //Throws error here
              return View("Index",d);
          }
  </code></pre>
  
  <p>When the DashboardContextclass is instantiated the error are shows up for both of the DBset properties.</p>
  
  <p>Is there are a reason why the  controller calling the wrong database? </p>
  
  <p>EDIT:</p>
  
  <p>FavoriteProject is in a different context (our main data model) and not related to the new custom model.</p>