Click here to Skip to main content
15,888,007 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i created a project with firstcode with web api

What I have tried:

this what i got in the package manager console

PM> Enable-Migrations
Checking if the context targets an existing database...
Code First Migrations enabled for project DAL.
PM> Add-Migration Initial
Scaffolding migration 'Initial'.
The Designer Code for this migration file includes a snapshot of your current Code First model. This snapshot is used to calculate the changes to your model when you scaffold the next migration. If you make additional changes to your model that you want to include in this migration, then you can re-scaffold it by running 'Add-Migration Initial' again.
PM> Update-Database
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
Applying explicit migrations: [201810282115304_Initial].
Applying explicit migration: 201810282115304_Initial.
Running Seed method.
PM> Update-Database -Verbose
Using StartUp project 'BL'.
Using NuGet project 'DAL'.
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
Target database is: 'DAL.FinalContext' (DataSource: (localdb)\mssqllocaldb, Provider: System.Data.SqlClient, Origin: Convention).
No pending explicit migrations.
Running Seed method.
PM>


but i cant see the db that created (if it created)
i see that i have two files, the first is : Model1.Desiner.cs
the second is: Models1.edmx.diagram
are this files connected to the db that created?
if yes - what do i need to do with it?
and if no - so whats is the problem
thanks!
Posted
Updated 29-Oct-18 6:15am
Comments
Richard Deeming 30-Oct-18 11:39am    
Target database is: 'DAL.FinalContext' (DataSource: (localdb)\mssqllocaldb, Provider: System.Data.SqlClient, Origin: Convention).

You haven't configured a connection string, so EF is using LocalDB by default:
SQL Server 2016 Express LocalDB | Microsoft Docs[^]

1 solution

Those are files within your project that let the application know what the DB context should look like.

The easiest way to determine if it was created would be try to connect to and use it (the DB)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900