How to switch EF to different database dynamically? RRS feed

  • Question

  • I have different databases for different companies. All the databases have the same tables and schema. Based on company id, I need to determine which database I should use, then run Linq to EF to query data.

    Currently I only know EF using the database defined in the connection string of its configuration file. How can I dynamically provide database name for EF?

    I also have the same problem when using WCF DataService, which is built on top of EF.

    Thanks in advance!!!

    Wednesday, March 26, 2014 6:50 PM


All replies