Print Page | Close Window

EFContextProvider dynamic connectionstring

Printed From: IdeaBlade
Category: Breeze
Forum Name: Community Forum
Forum Discription: Build rich JavaScript apps using techniques you already know
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3812
Printed Date: 28-Mar-2024 at 8:53am


Topic: EFContextProvider dynamic connectionstring
Posted By: Marcel
Subject: EFContextProvider dynamic connectionstring
Date Posted: 19-Nov-2012 at 5:20am
Hi,
 
At the moment i have an application (web/silverlight) where the connectionstring for my ObjectContext is dynamic.
It is based on how a user logs in because each of my customers have their own database. ie.. mailto:username@domain - username@domain .
I'm trying to find a way to use the EFContextProvider which would be by either passing the ObjectContext through the constructor, or by overriding the GetConnectionString, which sadly both aren't supported.
 
Is there a way to accomplish this, or can i download the source for the EFContextProvider somewhere so i can implement it myself ?
 
Thanks in advance.



Replies:
Posted By: Marcel
Date Posted: 19-Nov-2012 at 7:08am
I downloaded the source and added a constructor to the EFContextProvider which accepts an instance of T to be able to use an existing ObjectContext/DbContext which works like a charm.



Print Page | Close Window