After reading this nice post about reading application setting and config from appsettings.json file, I'm little confused about how many times appsettings.json will be read?
This is The Startup class and when the application has been started to work read it for the first time(I guess, If I'm wrong please correct me).
public class Startup
{
public IConfiguration Configuration { get; }
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
...
on the controller:
public class HomeController : Controller
{
private readonly IConfiguration _config;
public HomeController(IConfiguration config)
{
_config = config;
}
...
The question is that appsettings.json will be read for once time on the Start class or every time we use HomeController it will be read?
Because it's a file and I'm asking about the Reading counts from a physically file on the HDD.