How to support multiple Database at Entity Framework Core

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
ivoryguard
Posts: 8
Joined: Wed 13 Oct 2010 01:11

How to support multiple Database at Entity Framework Core

Post by ivoryguard » Fri 09 Jul 2021 09:17

Hello.

I have implemented multiple DB support in a single .NET Framework 4.6 project with DB-First EDMX way at Entity Framework 6.

Now, I will covert my existing app to.NET 5 app using Entity Framework Core including Code first migration. I want to support MSSQL, Oracle, MySQL in a single .NET 5 project by changing DB connection string only.

I have already purchased latest DotConnect for Oracle and MySQL.

Could you please let me know how I can support multiple Database in a single .NET 5 project?

Best regards.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: How to support multiple Database at Entity Framework Core

Post by Shalex » Mon 12 Jul 2021 12:39

We will notify you when the Database Independent property of the EF Core template is implemented.

As a workaround, you can run Regenerate Storage and Mapping from the diagram's context menu. It will clear all SQL Type values for columns. The drawback is that it will clear table name values as well so the table names will be determined automatically based on the class names.

ivoryguard
Posts: 8
Joined: Wed 13 Oct 2010 01:11

Re: How to support multiple Database at Entity Framework Core

Post by ivoryguard » Fri 08 Oct 2021 05:51

I implemented it according to the following post and it worked well :)
https://dev.to/moesmp/ef-core-multiple- ... iders-3gb7

Best regards.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: How to support multiple Database at Entity Framework Core

Post by Shalex » Fri 08 Oct 2021 16:09

Thank you for providing a possible solution. We will notify you when the feature is implemented.

Post Reply