Closed neelmallepally closed 6 years ago
We JUST did this on stream on Thursday the 12th. Code is here: https://github.com/csharpfritz/CoreWiki/tree/dev/CoreWiki.Data and video is here: https://www.youtube.com/watch?v=k-y6hCm-isI
Break down your code... what is different between it and my implementation? Can you use my implementation without getting an error?
I have moved models and applicationdbcontext class into a separate class library project. Running
dotnet ef migrations add MigrationName --project ProjName.Data.csproj
produced an error message -The link in the error message was useful. It says
The issue was fixed after creating a class deriving from
IDesignTimeDbContextFactory
in the class library project as suggested in the article. You didn't get this error message in the CoreWiki live stream when your moved DbContext to a class library or did I miss it? There is no class derived fromIDesignTimeDbContextFactory
in CoreWiki repo either.It seems like I'm definitely missing something but not sure what it is. I do not have problem keeping that extra class in my class library project but scratching my head why this was not an issue in your live stream. @benrick did similar refactoring and he did not get that error message either. Any thoughts? Sorry, if I have not provided enough details.
I tried asp.net core 2.1.1 and 2.1.2 versions.