Do I use Snapshot file, migration file or data annotations in my EF Core to update database?
<p>I'm trying to understand the different types of migration paths we can choose when developing an ASP.NET Core 1.0 application with EF Core. When I created my first Core application I noticed it generated a ApplicationDbContextModelSnapshot class that uses a ModelBuilder to build the model. </p>

<p>Then I read that if I need to add a table to the database, I need to create the new model and run the command line to generate the migration file and update the database. Ok, I get it up to this point.</p>

<p>But when I do that, I notice that the ApplicationDbContextModelSnapshot class gets updated too. </p>

<p>1) Does that mean I cannot modify this ApplicationDbContextModelSnapshot class since it looks like it gets regenerated each time?</p>

<p>2) Should I use Data Annotations to build my model or should I use Fluent API which tells me to build my model in the ApplicationDbContext class? Huh? another file that builds the model?</p>

<p>I'm seeing three different ways of working with the database here, the snapshot class, data annotations, and fluent API. I'm confused because today, I made a mistake in my last migration file so I deleted the file, dropped the database and reran the database update. </p>

<p>But by doing that I got errors similar to:</p>

<pre><code>The index 'IX_Transaction_GiftCardId' is dependent on column 'GiftCardId'.
ALTER TABLE ALTER COLUMN GiftCardId failed because one or more objects access this column.
</code></pre>

<p>So naturally I was wondering if I had to modify the ApplicationDbContextModelSnapshot class.</p>

<p>What is the path I should be taking when it comes to migrations or database updates because these three paths are confusing me.</p>