コード例 #1
0
 public ConfigFields()
 {
     DefaultConnectionString = string.Empty;
     PathSetting             = new AppConfigPathSetting();
     JWTSetting = new AppConfigJWTSetting();
     Key        = string.Empty;
 }
コード例 #2
0
        public ConfigFields(IConfiguration config) : this()
        {
            DefaultConnectionString = config.GetConnectionString("DefaultConnection");
            PathSetting             = new AppConfigPathSetting()
            {
                ApplicationPath = config.GetValue <string>("PathSetting:ApplicationPath"),
                LogPath         = Path.Combine(config.GetValue <string>("PathSetting:ApplicationPath"),
                                               config.GetValue <string>("PathSetting:LogFolder"))
            };

            config.GetSection("JWTSetting").Bind(JWTSetting);
            Key = config.GetValue <string>("Key");
        }