I have received the job of making a website that will permit our various large clients to log into our website and then click our various pages to see statistics data according to their sales.
Does anybody have understanding of the easiest method to handle multiple databases based from the user? Allows say we've 3 large title clients, the look decision has been manufactured each large client has their very own database.
If your user from clientA logs into our bodies they ought to begin to see the statistics for his or her company, and also the model ought to be tugging lower from clientA's data context. Likewise, if a person logs in and they're connected with clientB within the database then they have to get their data drawn from that data context.
Basically can, I must have one Data Access Layer class designed in LINQ and also have a way of passing within the connected DataContext with this user once they login. Can anybody think about a suitable or clean method of doing this?
When the schema's are identical for those databases, then it is quite simple. The datacontext comes with an overload that takes an association string. Simply keep various connection strings in certain centralized location (database, XML, resource, whatever) after which just create one datacontext with this connection string which you'll then use no matter who's connected.