Geeta
Geeta

Reputation: 31

How To Enable Migration in .net Core?

Enable-Migrations -ProjectName SampleApplication -ContextTypeName MyDbContext 

I have given the above command but it's not working? To Enable Migration Which Command need to Apply?

Upvotes: 3

Views: 15042

Answers (2)

Rob.Ak
Rob.Ak

Reputation: 237

Migrations are enabled by default in EF Core but you have to install

Microsoft.EntityFrameworkCore.Tools

nuget package. It looks like that package isn't installed by default with EF Core.

Upvotes: 9

Dmitry
Dmitry

Reputation: 16795

With EFCore you do not need to "enable" migrations - they are always-enabled. Just add new migration with Add-Migration.

Documentation about package manager commands is here

Upvotes: 0

Related Questions