Code first entity framework ile console ile migration işlemleri


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
PM> Enable-Migrations
No packages installed.
The EntityFramework package is not installed on project 'WorkSpace'.
PM> Enable-Migrations
No packages installed.
The EntityFramework package is not installed on project 'WorkSpace'.
PM> Enable-Migrations
No packages installed.
The EntityFramework package is not installed on project 'WorkSpace'.
PM> Install-Package EntityFramework
'EntityFramework 6.1.2' already installed.
Adding 'EntityFramework 6.1.2' to WorkSpace.
Successfully added 'EntityFramework 6.1.2' to WorkSpace.

Type 'get-help EntityFramework' to see all available Entity Framework commands.
One or more packages could not be completely uninstalled: EntityFramework.6.1.1. Restart Visual Studio to finish uninstall.

PM> Enable-Migrations
No context type was found in the assembly 'WorkSpace'.
PM> Enable-Migrations
No context type was found in the assembly 'WorkSpace'.
PM> Enable-Migration
Enable-Migration : The term 'Enable-Migration' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was includ
ed, verify that the path is correct and try again.
At line:1 char:1
+ Enable-Migration
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Enable-Migration:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
PM> Enable-Migrations
No context type was found in the assembly 'WorkSpace'.
PM> Enable-Migrations
Checking if the context targets an existing database...
Detected database created with a database initializer. Scaffolded migration '201412251230197_InitialCreate' corresponding to existing database. To use an automatic migration instead, delete the Migrations folder and re-run Enable-Migrations specifying the -EnableAutomaticMigrations parameter.
Code First Migrations enabled for project WebApplication1.
PM> Add-Migration
cmdlet Add-Migration at command pipeline position 1
Supply values for the following parameters:
Name: AddArtistUrl
Scaffolding migration 'AddArtistUrl'.
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 AddArtistUrl' again.
PM> Add-Migration AddArtistUrl
Re-scaffolding migration 'AddArtistUrl'.
PM> Update-Database
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
Applying explicit migrations: [201412251308164_AddArtistUrl].
Applying explicit migration: 201412251308164_AddArtistUrl.
Running Seed method.
PM>



Daha fazla bilgi için http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-code-based-migrations-walkthrough.aspx

Yorumlar

Bu blogdaki popüler yayınlar

22.06.2020 - 26.06.2020 arası işler

Asp.net RestSharp ile data post etmek

List Box Item içindeki elemanları aşağı veya yukarı taşımak