小编Krz*_*ous的帖子

ASP.NET Core 与接口绑定嵌套配置

我有一些配置界面

public interface IAppConfig
{
    IFeatureConfiguration FeatureConfiguration { get; set; }
    IOtherConfiguration OtherConfiguration { get; set; }
}
public interface IFeatureConfiguration 
{
    string SettingFoo { get; set; }
}
public interface IOtherConfiguration 
{
    string SettingBar { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

和课程

public class AppConfig : IAppConfig
{
    public IFeatureConfiguration FeatureConfiguration { get; set; }
    public IOtherConfiguration OtherConfiguration { get; set; }
}
public class FeatureConfiguration : IFeatureConfiguration 
{
    public string SettingFoo { get; set; }
}
public class OtherConfiguration : …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-core

6
推荐指数
1
解决办法
2011
查看次数

标签 统计

asp.net-core ×1

c# ×1