1.2 KiB
Adding a model
By Rick Anderson and Tom Dykstra
In this section you'll add some classes for managing movies in a database. These classes will be the "Model" part of the MVC app.
You’ll use these classes with the Entity Framework Core (EF Core) to work with a database. EF Core is an object-relational mapping (ORM) framework that simplifies the data-access code that you have to write. For this tutorial you'll use SQLite, but EF Core supports many database engines.
The model classes you'll create are known as POCO classes (from "plain-old CLR objects") because they don't have any dependency on EF Core. They just define the properties of the data that will be stored in the database.
In this tutorial you'll write the model classes first, and EF Core will create the database. An alternate approach not covered here is to generate model classes from an already-existing database. For information about that approach, see ASP.NET Core - Existing Database.