2

I have

IConfiguration cfg;
string keyName;

Will cfg.GetSection(keyName) tell me whether the key exists inside cfg ?

I just need to know if the key (keyName) exists.
I don't care about its value.

codeKnight
  • 241
  • 2
  • 12
  • 1
    Does this answer your question? [How to check if a section in MVC Core configuration file exist?](https://stackoverflow.com/questions/41606148/how-to-check-if-a-section-in-mvc-core-configuration-file-exist) As well as [How to check if Configuration Section exists in .NET Core?](https://stackoverflow.com/questions/44641488/how-to-check-if-configuration-section-exists-in-net-core) – Pavel Anikhouski May 13 '20 at 16:02

0 Answers0