Ban*_*ake 5 .net c# configuration .net-core asp.net-core
在 .NET Framework 中,我习惯于使用属性 - 设置 ( Properties.Settings.Default.SomeSettingsValue) 中的设置。使用起来非常简单和干净。我现在开始使用.NET Core,但是没有任何这样的设置。我找到了一些解决方案,但没有一个像旧的那样干净简单。
Properties.Settings.Default.SomeSettingsValue
.NET Core 中设置的最佳实践和解决方案是什么?
谢谢。
Mik*_*der 4
我认为您正在寻找选项模式
public class AppSettings { public string Setting1 { get; set; } }
services.Configure<AppSettings>(Configuration);
IOptions<AppSettings> appSettings
归档时间:
6 年,3 月 前
查看次数:
4941 次
最近记录: