To learn ASP.NET MVC, we are Building an Internet Application.
Part VII: Adding a Data Model.
The MVC Model contains all application logic (business logic, validation logic, and data access logic), except pure view and controller logic.
With MVC, models both hold and manipulate application data.
The Models Folder contains the classes that represent the application model.
Visual Web Developer automatically creates an AccountModels.cs file that contains the models for application security.
AccountModels contains a LogOnModel, a ChangePasswordModel, and a RegisterModel.
The database model needed for this tutorial can be created with these simple steps:
Note:
We have deliberately named the model class "MovieDB". In the previous chapter, you saw the name "MovieDBs" (endig with s) used for the database table. It looks strange, but this is the naming convention you have to use to make the model connect to the database table.
The database controller needed for this tutorial can be created with these simple steps:
Visual Web Developer will create the following files:
The following files are automatically created in the Movies folder:
Congratulations. You have added your first MVC data model to your application.
Now you can click on the "Movies" tab :-)
Your message has been sent to W3Schools.