Open Closed

Getting data from multiple databases in one microservice. #8075


User avatar
0
rogercprops created
  • ABP Framework version: v7.2 Commercial
  • UI Type: Vue
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..) / MongoDB
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace: N/A
  • Steps to reproduce the issue: N/A

We're following the microservices architecture with the Abp Commercial microservices template.

We have a complex reporting requirement where we need to pull data from multiple domains, which means multiple databases. We tried to follow this article: https://abp.io/community/articles/how-to-use-multiple-dbcontexts-in-a-single-query-execution-488bxj4q but it didn't work.

How do we accomplish this within one microsercie without having to make service to service api calls?

Thanks


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    How do we accomplish this within one microsercie without having to make service to service api calls?

    You have to add the EntityFrameworkCore project reference and module dependencies then add db connection strings to appsettings.json. this way you can inject the Repository to get data.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11