ASP.NET MVC

Code First: Model Classes

In MVC there are three approaches to developing the database. In code first simple C# classes are created, each one matching a Database table. Thus a Customers database table would be matched by a Customer class. Note table names are plural and class names are singular. This naming convention must be strictly followed if the automatic linking of classes to tables is to occur without errors.

Once the classes have been created, they can be used to automatically create a corresponding database. However any changes to the classes will result in the database needing to be updated. This is done through the use of data migrations.

MVC Index