Skip to content

Commit

Permalink
Fix two typos in adding-a-new-field.md file (dotnet#5557)
Browse files Browse the repository at this point in the history
* Fix typo in adding-a-new-field.md

* Fix typo in adding-a-new-field.md
  • Loading branch information
addianto authored and scottaddie committed Feb 27, 2018
1 parent ee823c7 commit a3eb114
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Doing so adds the following using statement:
>
> [!code-csharp[Main](adding-a-new-field/samples/sample4.cs)]
>
> This code assumes that titiles are unique. If you manually add a duplicate title, you'll get the following exception the next time you perform a migration.
> This code assumes that titles are unique. If you manually add a duplicate title, you'll get the following exception the next time you perform a migration.
>
> *Sequence contains more than one element*
>
Expand Down Expand Up @@ -139,7 +139,7 @@ You're seeing this error because the updated `Movie` model class in the applicat

There are a few approaches to resolving the error:

1. Have the Entity Framework automatically drop and re-create the database based on the new model class schema. This approach is very convenient early in the development cycle when you are doing active development on a test database; it allows you to quickly evolve the model and database schema together. The downside, though, is that you lose existing data in the database — so you *don't* want to use this approach on a production database! Using an initializer to automatically seed a database with test data is often a productive way to develope an application. For more information on Entity Framework database initializers, see [ASP.NET MVC/Entity Framework tutorial](../getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application.md).
1. Have the Entity Framework automatically drop and re-create the database based on the new model class schema. This approach is very convenient early in the development cycle when you are doing active development on a test database; it allows you to quickly evolve the model and database schema together. The downside, though, is that you lose existing data in the database — so you *don't* want to use this approach on a production database! Using an initializer to automatically seed a database with test data is often a productive way to develop an application. For more information on Entity Framework database initializers, see [ASP.NET MVC/Entity Framework tutorial](../getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application.md).
2. Explicitly modify the schema of the existing database so that it matches the model classes. The advantage of this approach is that you keep your data. You can make this change either manually or by creating a database change script.
3. Use Code First Migrations to update the database schema.

Expand Down

0 comments on commit a3eb114

Please sign in to comment.