且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用实体框架从多个数据库中检索数据

更新时间:2023-02-13 14:43:25

您可以为另一个数据库创建另一个DBContext和实体。

或者你可以创建新的API项目并调用其端点来获取其他信息。

或者您可以创建一个调用另一个数据库的存储过程,并在当前的DBContext中调用存储过程。
You can create another DBContext and entities for another database.
Or you could create new API project and call its endpoint to get other information.
Or you could create a Stored Procedure that call another database, and call the stored procedure in your current DBContext.