在运行时实体Framework Core C#中动态添加表格到数据库
我正在寻找一种使用EntityFramework Core在运行时将表添加到数据库的方法,我想使用modelBuilder
或MigrationBuilder
,但我无法通过操作到达这些类控制器中的方法我不想使用onModeLcreating
,因为它只有在执行应用程序后才运行一次,是否有任何解决方案可以动态地将表添加到数据库,而无需执行以下步骤手册”停止应用程序的运行,并在模态中手动添加一个类,然后进行“添加迁移”,然后“ update-database'”?
I'm looking for a way to add table to database in runtime with entityframework core, i would like to use ModelBuilder
or MigrationBuilder
but I can't reach these class via Action method in controller i don't want to use OnModelCreating
because it will run only one time once the application is executed, is there any solution to add table to database dynamically without need to do the following steps manual "stop the running of the application and add manually a class to modals and do 'add-migration' then the 'update-database'" ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论