I would like to use EF 4.0 against Oracle. The challenge I have is that I have multiple databases (all with nearly identical schemas) for different clients. Is it possible to generate my CRUD layer once, and then point at the correct database at runtime based on user identity (or whatever criteria I need to supply)? I think I can handle the small differences between schemas by using POCO classes or just handling it in the partial classes, but I'm not sure how to handle directing to the correct database. Any Ideas?
+1
A:
The most simple solution is to create several named connection strings in your configuration file and then simply to create different instances of the same ObjectContext with different conection string parameter using a parameterized constructor.
Don't forget to delete the Schema attribute from your .edmx file (using XML Editor, for example).
Devart
2010-07-14 10:10:28
Thanks Devart, we'll be using your connector by the way.
2010-07-14 10:59:15