title: Entity Framework CTP4: where to put SetInitializer?
body: <p>I am attempting to add Entity Framework, code first, to an MVC application that's been running with test data, using the CTP4 preview.</p>
  
  <p>I am currently getting this error:</p>
  
  <p><strong>The model backing the 'SchedulerContext' context has changed since the database was created.  Either manually delete/update the database, or call Database.SetInitializer with an IDatabaseInitializer instance.  For example, the RecreateDatabaseIfModelChanges strategy will automatically delete and recreate the database, and optionally seed it with new data.</strong></p>
  
  <p>I do not want to generate a database at all, as I already have a database. So I tried adding the following to the SchedulerContext constructor:</p>
  
  <pre><code>Database.SetInitializer&lt;SchedulerContext&gt;(new CreateDatabaseOnlyIfNotExists&lt;SchedulerContext&gt;());
  </code></pre>
  
  <p>which had no effect at all -- I got the same error the next time it ran. The error seems to occur when it is executing a LINQ statement that accesses the database -- the first, I think.</p>
  
  <p>Where should I put this statement, or is this statement the answer to this problem at all?</p>