How to add new Model in MVC C#?

Updated on     Kisan Patel

In Previous Article I told you About how to create Controller in project Here is the link

Now In your current project you can add models from this steps
if you want to add Model then you have to add class.so now,

Right click on Models folder in solution explorer , then select Add , In add click on Class then popup will open to Add Class

Roght click in Solution exploror on Model folder -> Add -> Class

Roght click in Solution exploror on Model folder -> Add -> Class

Then in popup window add Model name in Name field then press Add.

In popup select Class then give the name of Model then click Add

In popup select Class then give the name of Model then click Add

then your page will open with no entries in it so you have to enter your model details in your model

Add Properties  in Your model

Add Properties in Your model

Now you created your model so you can create your controller from this model.

You can validation in your properties for more details about Validation Here is The Link


ASP.NET MVC

Leave a Reply