Initial commit
This commit is contained in:
25
App/Helper/ParameterHelper.cs
Normal file
25
App/Helper/ParameterHelper.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user