benin101
benin101

Reputation: 131

Multiple database support with entity framework

I am new to entity framework. Sadly My first task involves using it to create an architecture that can connect to MsSql or Mysql database just by changing the connection string. Both database will have the same schema. Can anyone guide me or point to a resource that can help me with this? Thanks.

Upvotes: 1

Views: 634

Answers (1)

Wahid Bitar
Wahid Bitar

Reputation: 14102

Everything should be fine just make sure that you set the two connection strings in your config file.

Then make sure that you'll pass the connection string name to the DbContext in the constructor


Update :

Of course it's better to use Code Only approach

Upvotes: 2

Related Questions