ASP.NET CORE – Adding Models Folder and Models Class to Project


In this chapter you will learn

  • Basic Understanding of Models in ASP.NET Core.
  • What is Models Folder and what is does?
  • Adding Models class to your project.

Basic Understanding of Models class in ASP.NET Core

Models is a mandatory division of MVC pattern that keeps all the class files that process database operations. Simply all the class files that have logic to database connectivity, querying and searching data, edit, delete and updating of data are stored inside this folder. Till Now, you learned how to add View and Controller but now you will learn how to add models in ASP.NET Core Project.

How it works?

1. Model Fetches Data from Database. 2. Controller Fill this Data to Views 3. Views Display that Data to User.

Adding Models

If the Models folder is missing then you can simple add a new folder and rename it Models. Right click on your project name in solution explorer