You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
732 B
22 lines
732 B
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace EDOOKAAPI
|
|
{
|
|
public static class AppParams
|
|
{
|
|
public static string connectionstring { get;set; }
|
|
public static IConfigurationRoot GetConfiguration()
|
|
{
|
|
var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
|
|
return builder.Build();
|
|
}
|
|
|
|
public static void SetConnectionstring()
|
|
{
|
|
var configuation = GetConfiguration();
|
|
connectionstring = configuation.GetSection("ConnectionStrings").GetSection("EDOKAConnection").Value;
|
|
//return connectionstring
|
|
}
|
|
}
|
|
}
|