Udai Mathur

Udai Mathur

  • NA
  • 49
  • 11k

WEB API with Dapper

May 16 2019 12:13 AM
With reference to below given article:
https://www.c-sharpcorner.com/article/asp-net-core-web-api-with-dapper-and-vs-2017/
 
I want connection string to be get at runtime in the above given web api article.
I have one common DB in which I have all the client DB details with its connection string in the client table.
 
I have user table in which all the users with its client id.
 
When user logs into my system with its user name and password then I get which DB I have use with its connection string.
 
One solution I have is that in each and every method I have to send the DB name as the parameter.
 
But I want common wrapper class that handle the run time DB.
 
Can we handle multiple database scenario on runtime with this architecture. Please suggest.

Answers (5)