title: ASP NET MVC 3 - How to reset database in code first, with two tables and Database.Setinitializer?
body: <p>My problem lies in the lack of experience in MVC. Basically, I have two tables in DB
  -Person
  -Offer</p>
  
  <p>For each I have created a model and a controller and a model, so the structure looks like that:</p>
  
  <pre><code>public class Offer
  {
      public int OfferID { get; set; }
      public string OfferTitle { get; set; }
      public string State { get; set; }
      public string Description { get; set; }
  }
  
  public class OfferDBContext : DbContext
  {
      public DbSet&lt;Offer&gt; Offers { get; set; }
  }
  </code></pre>
  
  <p>This is the Offer model.</p>
  
  <pre><code>public class Person
  {
      public int PersonID { get; set; }
      public string Username { get; set; }
      public DateTime Birthday { get; set; }
      public string Education { get; set; }
      public string Email { get; set; }
  }
  
  public class PersonDBContext : DbContext
  {
      public DbSet&lt;Person&gt; Persons { get; set; }
  }
  </code></pre>
  
  <p>This is the Person model.</p>
  
  <p>Firstly I created the Person model, that added itself to db without any problems. Then I wanted to add Offer table, and I had to use the DropCreateDatabaseIfModelChanges method. I used it for OfferInitializer and PersonInitializer and then there is the Global.asax.cs file</p>
  
  <pre><code>protected void Application_Start()
  {
      Database.SetInitializer&lt;OfferDBContext&gt;(new OfferInitializer());
      Database.SetInitializer&lt;PersonDBContext&gt;(new PersonInitializer());
  
      //Database.SetInitializer&lt;PersonDBContext&gt;(new PersonInitializer());
  
      AreaRegistration.RegisterAllAreas();
  
      RegisterGlobalFilters(GlobalFilters.Filters);
      RegisterRoutes(RouteTable.Routes);
  }
  </code></pre>
  
  <p>From what I understand, I cant do that simply because I am dropping database 2 times, each time populating only one table at a time. How do I reorganize it all, so that I can populate both or more tables at a time, or the whole database?</p>