JeremyLikness / BlazorWasmEFCoreExample

Example of a Blazor WebAssembly project that uses Entity Framework Core on the server for data access.

Home Page:https://blog.jeremylikness.com/blog/build-a-blazor-webassembly-line-of-business-app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Code First Migration using the database context 'ContactContext'

274188A opened this issue · comments

I been looking at approaches to carry out code first migrations using the Context for 'blazorcontactsdb' database (ContactContext). For example - adding a new property on the ContactsApp.Model.Contact class.

image

So the context obviously exists in a different assembly from ContactsApp.Server.

Is there some way of running a migration eg dotnet ef migrations add xxx -o Migrations with a switch so it can find the context in another project?

Cheers

I had to add a factory hint. Readme is updated to reflect the proper command.