Remove direct coupling with IConfiguration

Read all options in IConfiguration stored under key "EntityFramework:ContextName" in DbContextOptions.
Get ConnectionString & SqlServer:MaxBatchSize from DbContextOptions removing coupling with IConfiguration.
Move variable declaration to just before it is used.