CMS-webAPI is an application in .Net MVC Web API
use Nuget Package Manager Console Enter following commands:
Enable-Migrations Add-Migration Init Update-Database
Creates a database at location mentioned in Connection String
Other Commands
Update-Database –TargetMigration: MigrationName
Update-Database –Verbose
Update-Database -Script -SourceMigration: $InitialDatabase -TargetMigration: AddPostAbstract
Enable-Migrations -ContextTypeName DBContextTypeName where DBContextTypeName can be CMS_webAPI.Models.CmsDbContext
enable-migrations -ContextTypeName -MigrationsDirectory: Add-Migration -configuration Update-Database -configuration -Verbose
Example:
enable-migrations -ContextTypeName CMS_webAPI.Models.DataContext -MigrationsDirectory:ApplicationDbContextMigrations Add-Migration -configuration CMS_webAPI.ApplicationDbContextMigrations.Configuration Initial Update-Database -configuration CMS_webAPI.ApplicationDbContextMigrations.Configuration -Verbose