DatabaseFactory previously used ConnectionString to create database. Now DatabaseProviderFactory uses ConfigurationSource which basically works on MVC 5 structure of web.config in XML form.
Previously we could do something like below:
string stConnName = Configuration["Data:DefaultConnection:ConnectionString"]; string stProvider = Configuration["Data:DefaultConnection:ProviderName"]; Database oDb = DatabaseFactory.CreateDatabase(stConnName);
Any idea about how to get JSON based database configurations as currently being used in MVC 6 (appsettings.json) for EnterpriseLibrary 6 in DatabaseProviderFactory , in order to create generic Database. Basically in order to do something like below, which only works with MVC 5's web.config files of XML form:
FileConfigurationSource fileConfig = new FileConfigurationSource("web.config"); DatabaseProviderFactory dbProvider = new DatabaseProviderFactory(fileConfig); Database oDb = dbProvider.Create("DBConnection");