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.

30 lines
766 B

using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace BlazorApp.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();
}
}
}