How to Use Crosslight v2 Business Template with Multiple Databases?

6 replies. Last post: August 7, 2014 5:33 PM by Domingo Fugaban
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hey Guys,

We are fairly new to Web API, and based on Crosslight's business template, we have no idea how we can configure this template to connect to a database depending on which client is requesting access. We have an existing WCF web service, wherein each method has a parameter called CompanyCode. Ideally we should be able to pass in a CompanyCode, and based on this CompanyCode the connection string will be dynamically created and passed on to the constructor of the database context or entity at runtime. But the same idea doesn't fit with the account and authentication services, nor any other services from the business template because it is tightly-coupled to a single database, initially.

So, kindly advise how we can extend the business template and services to allow an application to connect to a specific database at runtime. We don't want to move astray from Crosslight templates by creating our own services... so please shed some light to our concern and we are hoping you could provide a sample project as a solution.

All times are GMT -5. The time now is 7:39 PM.
Previous Next