Skip to content

Instantly share code, notes, and snippets.

@tetrashine
Last active September 22, 2022 20:59
Show Gist options
  • Save tetrashine/a8a44b353d45e5fdc46cd73a0183caf1 to your computer and use it in GitHub Desktop.
Save tetrashine/a8a44b353d45e5fdc46cd73a0183caf1 to your computer and use it in GitHub Desktop.
public class TestController : Controller
{
private IConfiguration _configuration;
public TestController(IConfiguration configuration)
{
_configuration = configuration;
Debug.WriteLine($"Config (MyKey): {_configuration.GetSection("MyKey")}");
Debug.WriteLine($"Config (App:Name): {_configuration.GetSection("App:Name")}");
Debug.WriteLine($"Config (App:Organisation:Email): {_configuration.GetSection("App:Organisation:Email")}");
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment