当前位置:网站首页>Configuring the help class iconfiguration in C # NETCORE
Configuring the help class iconfiguration in C # NETCORE
2022-06-27 05:45:00 【Sky watching house】
using System;
using System.IO;
namespace Microsoft.Extensions.Configuration;
public static class ConfigurationHelper
{
public static IConfigurationRoot BuildConfiguration(
AbpConfigurationBuilderOptions options = null,
Action<IConfigurationBuilder> builderAction = null)
{
options = options ?? new AbpConfigurationBuilderOptions();
if (options.BasePath.IsNullOrEmpty())
{
options.BasePath = Directory.GetCurrentDirectory();
}
var builder = new ConfigurationBuilder()
.SetBasePath(options.BasePath)
.AddJsonFile(options.FileName + ".json", optional: true, reloadOnChange: true);
if (!options.EnvironmentName.IsNullOrEmpty())
{
builder = builder.AddJsonFile($"{
options.FileName}.{
options.EnvironmentName}.json", optional: true, reloadOnChange: true);
}
if (options.EnvironmentName == "Development")
{
if (options.UserSecretsId != null)
{
builder.AddUserSecrets(options.UserSecretsId);
}
else if (options.UserSecretsAssembly != null)
{
builder.AddUserSecrets(options.UserSecretsAssembly, true);
}
}
builder = builder.AddEnvironmentVariables(options.EnvironmentVariablesPrefix);
if (options.CommandLineArgs != null)
{
builder = builder.AddCommandLine(options.CommandLineArgs);
}
builderAction?.Invoke(builder);
return builder.Build();
}
}
边栏推荐
- Webrtc series - Nomination and ice of 7-ice supplement for network transmission_ Model
- 流媒体协议初探(MPEG2-TS、RTSP、RTP、RTCP、SDP、RTMP、HLS、HDS、HSS、MPEG-DASH)
- [622. design cycle queue]
- 洛谷P4683 [IOI2008] Type Printer 题解
- 机械转码日记【17】模板,STL简介
- Logu p4683 [ioi2008] type printer problem solving
- Implementation of easyexcel's function of merging cells with the same content and dynamic title
- WebRTC系列-网络传输之7-ICE补充之提名(nomination)与ICE_Model
- [FPGA] UART serial port_ V1.1
- 双位置继电器XJLS-8G/220
猜你喜欢

Some articles about component packaging and my experience

躲避小行星游戏

【622. 设计循环队列】

Two position relay rxmvb2 r251 204 110dc

RTP 发送PS流工具(已经开源)

IAR Systems全面支持芯驰科技9系列芯片

Discussion on streaming media protocol (MPEG2-TS, RTSP, RTP, RTCP, SDP, RTMP, HLS, HDS, HSS, mpeg-dash)

Quick sort (non recursive) and merge sort
![[622. design cycle queue]](/img/f2/d499ac9ddc50b73f8c83e8b6af2483.png)
[622. design cycle queue]

AD22 gerber files 点开 gerber steup 界面 有问题 官方解决方法
随机推荐
Neo4j database export
three. JS first person camera gun following
Epics record reference 5 -- array analog input recordarray analog input (AAI)
Asp.Net Core6 WebSocket 简单案例
Wechat applet refreshes the current page
开门小例子学习十种用例图
项目-h5列表跳转详情,实现后退不刷新,修改数据则刷新的功能(记录滚动条)
1317. 将整数转换为两个无零整数的和
RTP sending PS stream tool (open source)
Double position relay rxmd2-1mrk001984 dc220v
QListWidget中的内容不显示
OpenCV的轮廓检测和阈值处理综合运用
论文解读(LG2AR)《Learning Graph Augmentations to Learn Graph Representations》
[FPGA] realize the data output of checkerboard horizontal and vertical gray scale diagram based on bt1120 timing design
[622. design cycle queue]
Niuke practice 101-c reasoning clown - bit operation + thinking
IAR systems fully supports Centrino technology 9 series chips
Tri rapide (non récursif) et tri de fusion
高翔slam14讲-笔记1
Edge loads web pages in IE mode - edge sets ie compatibility