Saturday, April 25, 2020

Asp.Net MVC Model

Asp.net MVC Tutorials about model View Controller

MVC stands for (Model - View - Controller ). The model is nothing but Properties as shown below. which we can use in Views. and we can do validations here by using Data annotations. if we want validations then we need to import the header files. by using the System.ComponentModel.DataAnnotations namespace. and it is responsible for maintaining the business logic and application data. the model does not depends on the controller and views. the views display the model data and send the user action to the controller.

namespace alltechgeeks.Models
{
    public class Student
      {
         public int Id { get; set; }
         public string name{ get; set; }
         public string city { get; set; }

       }
}

No comments: