Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Data.Entity.DataBase can't be found

I can't find DataBase in System.Data.Entity.

Any one know why?

Thank you.

like image 236
fligant Avatar asked Jun 11 '11 12:06

fligant


People also ask

How to add ado net Entity Data Model in visual studio 2022?

Create the ADO.NET Entity Data ModelRight-click on your project in the Solution Explorer window and select the menu option Add -> New Item. In the Add New Item dialog, select the Data category. Select the ADO.NET Entity Data Model template, give the Entity Data Model the name Northwind.


2 Answers

You dont have to import System.Data.Entity.Database. The System.Data.Entity is enough. Use Database.SetInitializer instead of DbDatabase.SetInitializer.

If you missed it it, the class is called Database without "Db"

like image 96
Kasper Skov Avatar answered Oct 05 '22 02:10

Kasper Skov


You need to reference the EntityFramework.dll assembly which is where the Database class is declared. You could install it from the corresponding NuGet package.

like image 36
Darin Dimitrov Avatar answered Oct 05 '22 03:10

Darin Dimitrov