Entityframework.docs: There is no Migrate method.

Created on 9 Feb 2019  Â·  2Comments  Â·  Source: dotnet/EntityFramework.Docs

Using Microsoft.EntityFrameworkCore.SQLite nuget v2.2.1 on a .Net Standard 2.0 project you reference as the "data model" project. It contains a class called "DataContext" who inherits the dbContext class. Successfully create the initial migration. In my UWP application, in the constructor of app.xaml.cs, I create an instance of my "DataContext" class, assign it to the db variable and call "db.Database.Migrate()". A CS1061 error indicates (translated) "'DatabaseFacade' does not contain a definition for 'Migrate'". Suspecting that a partial class should have been created with this method somewhere during the initial migration, I searched the whole solution for a migrate method and could not find any.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

closed-duplicate

Most helpful comment

Got it... I did not typed the "using Microsoft.EntityFrameworkCore;" in the app.xaml class. I suggest to accentuate the need for it.

All 2 comments

Got it... I did not typed the "using Microsoft.EntityFrameworkCore;" in the app.xaml class. I suggest to accentuate the need for it.

Duplicate of #481

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MohammadMQ picture MohammadMQ  Â·  3Comments

divega picture divega  Â·  3Comments

joakimriedel picture joakimriedel  Â·  3Comments

CubeSpark picture CubeSpark  Â·  3Comments

VirMaker picture VirMaker  Â·  4Comments