C
C#2y ago
flaspu

❔ Update my entity models every time my database changes.

Hi, I've got an application in Entity Framework and it shares the same database with another application but when the second application tries to update something in the database my models from my first application become desynced. Is there any way to see if the database changes and update the entities in order to sync? Thanks.
3 Replies
phaseshift
phaseshift2y ago
thats what 'migrate' and the ef tool are for, i believe
Angius
Angius2y ago
Create a separate project for just your database entities and DbContext, reference it from the other projects That way, both projects will always use the same database models, and they'll always be synced up with the database
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server