如何使用EF Core Power Tools在同一项目中管理多个dbcontext? [英] How to manage multiple dbcontext in same project with EF Core Power Tools?

查看:102
本文介绍了如何使用EF Core Power Tools在同一项目中管理多个dbcontext?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用不同的连接字符串在同一项目中管理多个上下文,我使用的是EF Core Power Tools,但是此工具正在为整个项目生成文件配置,值得注意的是,我正在使用Database First和在另一个类库项目中将实体与dbcontext分开.

I need to manage multiple context in the same project with different connection strings, I'm using EF Core Power Tools, but this tool it's generating a file config for whole project, worth noting that I'm working with Database First and separeting the entities from dbcontext in another class library project.

推荐答案

根据此处描述的模式将唯一名称分配给配置文件:

Assign a unique name to the config file according to the pattern described here: https://github.com/ErikEJ/EFCorePowerTools/wiki/Reverse-Engineering#using-multiple-dbcontexts-in-the-same-project

这篇关于如何使用EF Core Power Tools在同一项目中管理多个dbcontext?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆