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.
26 lines
719 B
26 lines
719 B
using Microsoft.Extensions.Configuration;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace sf1.Helper
|
|
{
|
|
public class ParameterHelper
|
|
{
|
|
|
|
public string GetParameter(string Keyvalue)
|
|
{
|
|
var configuation = GetConfiguration();
|
|
return configuation.GetSection("Appsettings").GetSection(Keyvalue).Value;
|
|
}
|
|
|
|
public IConfigurationRoot GetConfiguration()
|
|
{
|
|
var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
|
|
return builder.Build();
|
|
}
|
|
}
|
|
}
|