简体   繁体   中英

Adding tables to database in Entity Framework Database first

I have a project that is almost completed using Database first approach. I have a module in the application that manages plugins that could be plugged into the application at runtime without recompiling the application. The challenge is if the plugin will need to create tables in database, how do I do that ? The only way I know now is to delete '.edmx' and regenerate it from the database. But that's not what I want to do as I want individuals to plugin their small apps without having to drop and recreate '.edmx'.

Your plug-in should use it's own datacontext with it's own edmx file. The main app will not ever know about the additional tables. If the plug-in gets instantiated it should create the additional tables that it uses.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM