title: EF Core - can migrations in multiple contexts use same ContextModelSnapshot file
body: <p>I am using EF Core on .NET 6 with a code-first approach.</p>
  <p>I want to have two contexts that connect to the same database. I want them each to have an <code>Items</code> property.</p>
  <p>However, in one of them the <code>Items</code> property is mapped to the table in the database in one zone, while in the other in the other zone. E.g. <code>zone1.Items</code> and <code>zone2.Items</code>.</p>
  <p>The tables have different columns.</p>
  <p>So I have <code>Context1</code> defined as:</p>
  <pre class="lang-cs prettyprint-override"><code>public class Context1: IdentityDbContext&lt;User&gt;
  {
      public DbSet&lt;ItemOld&gt; Items { get; set; }
      // ...
      protected override void OnModelCreating(ModelBuilder builder)
      {
          base.OnModelCreating(builder);
  
          builder.Entity&lt;ItemOld&gt;().ToTable(&quot;Items&quot;, &quot;zone1&quot;);
          //...
      }
  }
  </code></pre>
  <p>and similar in <code>Context2</code> for <code>ItemNew</code> and <code>zone2</code>.</p>
  <p>If I want to make a change on the <code>ItemOld</code> class (e.g. add a property), in Package Manager Console I do something like:</p>
  <pre><code>Add-Migration AddedSomeProperty -Context Context1 -o MigrationsContext1
  </code></pre>
  <p>This adds a migration in my folder as expected, and creates the <code>Context1ContextModelSnapshot.cs</code> file in that same folder.</p>
  <p>I run <code>Update-Database -Context Context1</code> to update my database.</p>
  <p>But then, if I change something on the <code>ItemNew</code> class and try to do:</p>
  <pre><code>Add-Migration AddedSomePropertyOnItemNew -Context Context2 -o MigrationsContext2
  </code></pre>
  <p>EF Core will (as per my understanding and my situation):</p>
  <ol>
  <li>Look at the existing <code>ContextModelSnapshot</code> <strong>for that context</strong></li>
  <li>Find all the differences from the current database to the info in the current <code>ContextModelSnapshot</code></li>
  <li>Create the migration</li>
  </ol>
  <p>Hence, it will also pull the code needed to add a property to <code>ItemOld</code>, as the fact that it was already added was not available in the <code>Context2ContextModelSnapshot</code>.</p>
  <p>So, basically, I have a <code>ContextModelSnapshot</code> for each context and they differ if I add migrations to each context.</p>
  <p>An idea would be to have both contexts use the same <code>ContextModelSnapshot</code>, but I could not find a way to configure this - is there a way to do that?</p>
  <p>Is there a better way to approach this problem?</p>
  <p>Please close me down if the question is a bit vague, or let me know if I need to provide additional information.</p>