NETCore下IConfiguration和IOptions的用法

NETCore下IConfiguration和IOptions的用法

 

 https://www.cnblogs.com/RainingNight/p/strongly-typed-options-configure-in-asp-net-core.html

 

 

 if ("Y" == Configuration.GetSection("AppSettings").GetValue<string>("EnableQueue").ToUpper())
     Service.SOService._IsSendQueue = true;
{
  "ConnectionStrings": {
    "coon": "ccc"
  },

  "AppSettings": {   "EnableQueue": "Y"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "AllowedHosts": "*"
}

 

 public static Boolean _IsSendQueue { get; set; } 

 if (_IsSendQueue == true)

 

posted @ 2019-10-31 15:27  ProZkb  阅读(620)  评论(0编辑  收藏  举报