services.AddDbContext<MyDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
services.AddDbContext<MyDbContext1>(options =>
options.UseSqlServer(Configuration.GetConnectionString("Connection1")));
services.AddDbContext<MyDbContext2>(options =>
options.UseSqlServer(Configuration.GetConnectionString("Connection2")));
{
"ConnectionStrings": {
"Connection1": "YourConnectionString1",
"Connection2": "YourConnectionString2"
},
...
}