Last post Jul 02, 2015 07:37 AM by r0nn1e
Apr 05, 2015 03:16 PM|RichardLaw|LINK
I'm trying to follow the tutorial 'Using Web API 2 with Entity Framework 6'. I'm using MS Visual Studio Community 2013.
In Part 3 'Seed the Database', the first part says:
From the Tools menu, select Library Package Manager, then select Package Manager Console. In the Package Manager Console window, enter the following command: Enable-Migrations.
In my VS (Community 2013), there is no Library Package Manager in the tools menu. There is NuGet Package Manager with 'Package Manager Console' which I assume is the same thing? If I enter 'Enable-Migrations', I get the following error:
More than one context type was found in the assembly 'BookService'.
To enable migrations for 'BookService.Models.BookServiceContext', use Enable-Migrations -ContextTypeName BookService.Models.BookServiceContext.
To enable migrations for 'BookService.Models.ApplicationDbContext', use Enable-Migrations -ContextTypeName BookService.Models.ApplicationDbContext.
Thanks as always
Jul 02, 2015 07:37 AM|r0nn1e|LINK
Hi In case this has not been answered.
1) Open Nuget Package Manager Console Tools\Nuget Package Manager\Package Manager Console.
2) Type in enable-migrations (press enter) (You may get a message saying they are already enabled- thats' OK)
3) Type in update-database (press enter).
Now run your code and the data is there.