Sunday, August 18, 2013

EF Migration Commands

www.dotnetstory.com

Entity Framework Commands:-
1. Install Entity Framework any ver. 4.0 to 5.0

1.Install-Package EntityFramework
 
2. Enable Migration in project

2.Enable-Migrations

3. Enable Migration in particular Context in project

3.Enable-Migrations -ContextTypeName ProjectName.Models.DbContextName 

4. Fire command after enable migration

4.Add-Migration AddPostAbstract

5. Update Database

5. Update Database

6.Add-Migration

7.Update-Database –Verbose

8. In case changed colunm length then fire this command

add-migration MaxLengthOnNames
update-database


9.In case you changed colunm name then fire this command

add-migration ColumnFirstName
update-database


10.Add-Migration RowVersion
   Update-Database





 

No comments:

Post a Comment