Home »  Dot Net MVC Tutorial »  MVC Model

MVC Model

MVC Model

MVC Model represents the application data domain. In other words applications business logic is contained within the model and is responsible for maintaining data.

What is a MVC Model?

  • MVC model is basically a C# or VB.NET class.
  • MVC model is accessible by both controller and view.
  • MVC model can be used to pass data from Controller to view.
  • A view can use model to display data in page.

Adding a Model

In MVC Application Solution Explorer, right click the Models folder, select Add, and then select Class.

MVC Model

Enter the class name "Employee". and Add the following three properties to the Employee class:

   public class Employee
          public int EmployeeID { get; set; }
          public string EmployeeName { get; set; }
          public decimal Salary { get; set; }
Contact Us| About Us| Terms| Privacy Policies
Powered by Lorquins Technologies© 2017 QuickToStudy.com. All Rights Reserved