Dans appsettings.json
{
      "MyArray": [
          "str1",
          "str2",
          "str3"
      ]
}
Dans Startup.cs
public void ConfigureServices(IServiceCollection services)
{
     services.AddSingleton<IConfiguration>(Configuration);
}
Dans HomeController
public class HomeController : Controller
{
    private readonly IConfiguration _config;
    public HomeController(IConfiguration config)
    {
        this._config = config;
    }
    public IActionResult Index()
    {
        return Json(_config.GetSection("MyArray"));
    }
}
Il y a mes codes ci-dessus, j'ai obtenu null Comment obtenir le tableau?
"Clients": [ {..}, {..} ], vous devez appelerConfiguration.GetSection("Clients").GetChildren().