Domanda

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 ?

È stato utile?

Soluzione

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)).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top