I am trying to write my connection string in my appsettings.json file and bring it into my startup file but I keep getting a Value cannot be null. Parameter name: connection
Maybe you can try this:
services.AddDbContext(options =>
options.UseSqlServer("DefaultConnection")
);
Then set your appsettings.json do something like this:
"ConnectionStrings:": {
"DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=HOME1_DATABASE;Trusted_Connection=True;MultipleActiveResultSets=true"
},
After that, when a I add migration via the console, it succeeds.