I noticed some people use
var constring = builder.Configuration.GetConnectionString("DefaultConnection")!;
options.UseSqlServer(constring);
and some other people just use
options.UseSqlServer("name=DefaultConnection");
Are there any differences?
Note: Both read DefaultConnection key in appsettings.json.
"ConnectionStrings": {
"DefaultConnection": "server=.;database=MyDb;integrated security=true"
}