Short answer: No way.
Explanation:
There is no way to do this in .NET
since every ORM
(for e.g. Entity Framework
) uses it own design and architechture to connect to different DBRM. There is an E.F. for MSSQL
, another one for SQLite
, another one from MySQL
, there are versions from Microsoft or third party like Pomelo
in MySQL
, but the thing is that every EF
uses a different architecture.
Also, Entity Framework
is not made for huge bulks, the recommendation for this is use ADO.NET
. In this case, you could use plain SQL
. Take consideration that ADO.NET
could be vary also for some DBRM
in some Framework version.
As suggestion, you could use general classes and do the particular mappings, and so your own queries if the select would change in some DBRM that doesn't work with T-SQL. On this idea you could map to ADO.NET parameters
or Entity Framwerworks classes
In my observation I would go for ADO.NET
scenario, is more work but is pretty forward and you won't waste time using Reflection
or some architecture that can bring a lot of rework and bugs.
You could try use ADO.NET
for everything, use a dynamic connectionstring and try to do the work with the same repositories.
You can read my answer here to get an idea: https://stackoverflow.com/a/69574353/888472
Update:
As general architecture I would use a different layer (DAL) or you can use a REST API (DAS - Data Service) or you could use one DAL for every DBRM, it's on you and your need. Take consideration that web is not the best to work with bulks since timeouts.