I used ASP.NET MVC, Entity Framework Model First and Firebird database. Now we added Oracle database with same tables and fields and I want switch connection between Firebird and Oracle in runtime.

It is possible to use one data model for both databases ? Or, maybe, i need to create separate data models, but how I can used them ?

有帮助吗?

解决方案

Yes it is possible.

If you create an EDMX for each DB with the exact same CSDL section and generate classes for only one of them, then you can create a context that connects to the DB you want by specifying the correct connection string (which includes the correct EDMX elements (SSDL, CSDL, MSL)).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top