locked
What are benefits of creating migrations from the beginning of the project using EF Core? RRS feed

  • Question

  • I am setting up a new ASP.NET core mvc project with EF Core. Now, When I read the docs for help in implementation, it always says to create a migration file (.cs) and then update the database with the help of that file. But, If have to create a separate class and then update the database instead of the usual update database commands, wouldn't it kill the purpose of setting of db easily using EF Core? I mean simply running update database command will also do the same thing but without the additional step of creating a migration file. So my question is, while setting up a project from the scratch, is it necessary to create a migration file of every single step i.e while initial creation of database with basic table and schemas? if so what are the advantages?

    ms forum help

    Thursday, March 21, 2019 1:50 PM

All replies

  • .NET Core is designed to be cross platform. This mean you can also use it to build an App to run on your phone.

    If you're publishing an App that uses database locally, then migration class that will automatically update the schema to your expectation is handy.

    Friday, March 22, 2019 1:35 AM