Tuesday, December 24, 2013

Code First migration in asp.net MVC 4

Introduction: In this article I will explain how we can enable Code First migration in asp.net MVC 4

Description:

Migration is used to backup our database when we are going to develop application using code first approach in asp.net MVC.
I have a class named Student_Detail.cs in Models:
public class Student_Detail
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Subject { get; set; }
        public int Marks { get; set; }
    } 
Now I add a new property in this class for student address.

Thursday, December 19, 2013

Create, Read, Update and Delete in Asp.net MVC 4 using Code first approach

Introduction: In this article I will explain how we can Create, Read, Update and Delete in Asp.net with MVC 4 Razor view Engine using Entity framework with Code first approach.
MVC 4 Razor view Engine

Requirement:
I am using Visual studio 2012 to develop this project.

Description:

Add a MVC Project: