Saturday, November 3, 2018

Asp.Net MVC Model

Asp.net mvc model

MVC stands for (Model - View - Controller ). 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 System.ComponentModel.DataAnnotations namespace. and it is responsible for maintaining the business logic and application data. model does not depends on controller and views. the views displays the model data and sends the user action to controller.

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


No comments: