using Microsoft.Extensions.Configuration; using System; namespace Core.Util {
/// <summary> /// Profile help class /// </summary> public static class ConfigHelper {
private static IConfiguration _config; private static object _lock = new object(
); public static IConfiguration Configuration { get { if (_config == null) {
lock (_lock) { if (_config == null) { var builder = new ConfigurationBuilder() .
SetBasePath(AppContext.BaseDirectory) .AddJsonFile("appsettings.json"); _config
= builder.Build(); } } } return _config; } set { _config = value; } } ///
<summary> /// from AppSettings obtain key Value of /// </summary> /// <param
name="key">key</param> /// <returns></returns> public static string GetValue(
string key) { return Configuration[key]; } /// <summary> /// Get connection string ///
</summary> /// <param name="nameOfCon"> Connection string name </param> /// <returns></returns>
public static string GetConnectionString(string nameOfCon) { return
Configuration.GetConnectionString(nameOfCon); } } }

Technology
©2019-2020 Toolsou All rights reserved,
java Four functional interfaces ( a key , simple )os Simple use of module HashMap Explain in detail html Writing about cherry trees , Writing about cherry trees It's unexpected Python Cherry tree (turtle The gorgeous style of Library ) computer network --- Basic concepts of computer network ( agreement , system ) Some East 14 Pay change 16 salary , Sincerity or routine ? Browser kernel ( understand )