In case that we have in appsettings;
"settings": {
"url": "myurl",
"username": "guest",
"password": "guest"
}
and we have the class;
public class Settings
{
public string Url { get; set; }
public string Username { get; set; }
public string Password { get; set; }
}
we can use also;
var settings = builder.Configuration.GetSection("Settings").Get<Settings>();
var url = settings.Url;
Reference

