I am developing webapi with some knowledge of Core 2.0 I need to create two link to produce different result from different database both database schema are the same.
Like https://localhost:5000/m/University
or https://localhost:5000/v/University
They both fire in different database with same webapi application and give result it. I can produced result but I have to either create two webapi project or change connection string ("MConn") in Start up class.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<IISOptions>(options => { options.AutomaticAuthentication = true; });
services.AddDbContext<PIDBContext>(opt => opt.UseSqlServer(Configuration.GetConnectionString("MConn")));
services.AddMvc();
}
Could you help me how to use same Webapi project with different connection string based on Https request?
Thanks