Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Create a Entity Framework Project?

OK, so I feel dumb for asking this... but I am stumped.

I can't seem to create a project/unit for using the ADO.NET Entity Framework.

I looked for a project type that looked like it would match, but no go (closest I could find was ASP.NET Dynamic Data Entities Web Application).

I also tried to just add a unit (like you do for Linq-to-SQL). But I could not find anything "Entity Framework"y to add (though Linq-to-SQL is in the list). (Note: I tried adding it to a normal Class Library and to a WCF Project.)

Is there something I need to download? Is there an anti-stupid pill I need to take? ('cause I feel stupid for not being able to figure this out)

(I am using Visual Studio 2010 Ultimate connecting to SQL Server 2008)


Here is a screen shot of my Add New Item window:

Add New Item Window

I got this by right clicking on a Class Library Project and select Add New Item. There is no Entity Framework in it.

like image 833
Vaccano Avatar asked Oct 12 '10 21:10

Vaccano


People also ask

How do I add Entity Framework to an existing project?

Install Entity FrameworkRight click on your project name and select Manage NuGet Packages. Go to Browse and Select Entity Framework then click Install button to install Entity Framework on your project.


2 Answers

Begin with any Project (like a ClassLibrary) and Add an EF model.

There should be a "ADO.NET Entity Data Model" item in your "Add New Item" dialog.

like image 63
Henk Holterman Avatar answered Sep 30 '22 23:09

Henk Holterman


  1. In the Solution Explorer, Right-click, Add New Item.

  2. Select ADO.NET Entity Data Model in the Templates pane.

  3. Give it a name, and click the Add button.

http://msdn.microsoft.com/en-us/library/bb399739.aspx

like image 37
Robert Harvey Avatar answered Sep 30 '22 23:09

Robert Harvey