Currently, I don't use appsettings.json for storing the connection string.
I invoke "AddInMemoryCollection" method in program.cs and pass config key ("ConnectionStrings:CMSConnectionString") as parameter.
Even if use appsettings or memory-collection it doesn't work. I can access configuration object in middlewares and I can change the connection string. But application doesn't effect from this. Just works correctly when i restart.