Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework 5 code first - where is the database created

I am following along this tutorial! everything works great, the blog names saved and retrieved from the database (assuming) since they are displayed in the console. Yet there I don't find any database created for it in local db nor the sql express on my machine. How to find where is the database created in the code first approach.

like image 345
ZedBee Avatar asked Nov 29 '12 07:11

ZedBee


People also ask

How to create an Entity Framework data model in Visual Studio?

We will use the Entity Framework Tools for Visual Studio to help us generate some initial code to map to the database. These tools are just generating code that you could also type by hand if you prefer. Project -> Add New Item… Select Data from the left menu and then ADO.NET Entity Data Model

Why do we need Entity Framework?

The reason is simple as an Entity Framework is an overwhelming development communicator between our physical database engines and our code base. Entity Framework in ASP.NET MVC5 platform offers three approaches given below to connect with the database i.e. Code First Approach. Model First Approach. Database First Approach.

What is Entity Framework in mvc5?

There has been a lot of buzz about Entity Framework in the tech world. The reason is simple as an Entity Framework is an overwhelming development communicator between our physical database engines and our code base. Entity Framework in ASP.NET MVC5 platform offers three approaches given below to connect with the database i.e.

How do I import data from a database into Entity Framework?

Select Data from the left menu and then ADO.NET Entity Data Model Select the connection to the database you created in the first section and click Next Click the checkbox next to Tables to import all tables and click Finish


1 Answers

You can get the connection string by using ctx.Database.Connection.ConnectionString which will tell you what database you are using.

like image 119
Pawel Avatar answered Oct 03 '22 10:10

Pawel