Description:
Here i will explain how to insert update delete and select operation in asp.net mvc. We explained step by step to do this like the following below:
Step 1: Create new Asp.net MVC empty application.
Step 2: Create new Model Class by right click on Models => Add => Class named "EmpModel.cs"
Note: It is not mandatory that Model class should be in Model folder, it is just for better readability you can create this class anywhere in the solution explorer. This can be done by creating different folder name or without folder name or in a separate class library.
EmpModel.cs
Here i will explain how to insert update delete and select operation in asp.net mvc. We explained step by step to do this like the following below:
Step 1: Create new Asp.net MVC empty application.
Step 2: Create new Model Class by right click on Models => Add => Class named "EmpModel.cs"
Note: It is not mandatory that Model class should be in Model folder, it is just for better readability you can create this class anywhere in the solution explorer. This can be done by creating different folder name or without folder name or in a separate class library.
EmpModel.cs
public class EmpModel { [Display(Name = "Id")] public int Empid { get; set; } [Required(ErrorMessage = "First name is required.")] public string Name { get; set; } [Required(ErrorMessage = "City is required.")] public string City { get; set; } [Required(ErrorMessage = "Address is required.")] public string Address { get; set; } }