Model

This article explains about the usage of Model in Asp.Net MVC.The model represents data.The data from the database is stored within this model class or entity.So developers will create classes inside this model folder.Let us say for example, you are going to create customer related pages, you will be creating 'customer class' inside this model folder. The customer class consists of properties such as customerid,customername,customercountry,customerstate,customercity,customeremail,customercontact and customeraddress. Normally business logic is contained within the model and is responsible for maintaining data. Let us see, how to create model class in ASP.NET MVC.

Add a Model in ASP.NET MVC

Open Solution explorer and click Models folder.Now right click -->add -->click class


This model is being used in the View in order to display model data.The model is otherwise called as business entity also.The same model is used for performing business logic in controller.