asp.net-mvc-tutorial

The goal of this project is to provide a quick way to find how to do things in ASP.NET MVC

so we can focus on solving the real problems.

This repository contains branch based tutorials. Each small task is represented in few commits in a branch.

Environments

  • Visual studio 2013
  • ASP.NET MVC 5.2.2
  • .NET 4.5
  • EntityFramework 6.1.1

Tutorials

Create a default MVC project.

Create a Product model and scaffold it which automatically generates a controller and views providing CRUD operations for that model.

Default MVC project creates the database once automatically based on models but there is no way to update the structure since then. Using migrations can solve this issue.

Create a new field to a model and update the controller and views.

Test general and edge cases of each action from a scaffolded controller.

Add [Required] validation to a field and test.

Customize the field name and error message to [Required] validation

Create a House model and add fields having many types of native validations.

Create a Product model and add different types of custom validations.

  1. Custom validation to a field
  2. Custom validation to a field having a parameter
  3. Custom validation to a class