I am developing a mvc application in VS 2012 so I want use “MVC controller with read/write action and view using Entity Framwork” when adding controller. So I have create a edmx file and with entity Person in tt class code is as
namespace App1.Models
{
using System;
using System.Collections.Generic;
public partial class Person
{
public int PersonId { get; set; }
public string Name { get; set; }
public Nullable<System.Guid> UserId { get; set; }
}
}
But I am little bit confused what I have to do next to access above mentioned technique. And what is data context class what I need to do. Please assist here for same. Thanks in advance !!
Edit
yea, thanks for reply.I think I have not explained my problem in broad okay lets do that. I have data base already created now I added a edmx file it will create tt class. Now when I add controller following options are there : Please Click Here
So basically I want to know how I implement this.
You need to add a database context, then build it.
Then select add Controller, give the controller an name, and it will generate the controller and views for you.
When you run it, the table will be automatically created for you.
Have a look at this tutorial:
http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/intro-to-aspnet-mvc-4
Here is another link, explaining how to do it using the Entity Framwork.
http://msdn.microsoft.com/en-us/data/gg685489.aspx