First, is this the correct json? Do I need to specify the ProviderName?
"ConnectionStrings": {
"DefaultConnection": {
"ConnectionString": "Data Source=(local);Initial Catalog=MyDB;Integrated Security=SSPI;",
"ProviderName": "System.Data.SqlClient"
}
}
Second, the Program.cs file created by Visual Studio doesn't seem to have anywhere to insert a bunch of Dependency Injection type code. So where should it go?
Third, Microsoft's sample code for a Configuration object show a method called "GetConnectionString", yet the compiler says that method doesn't exist. Thank you, Bill.
I'd appreciate not just a fragment of code but also exactly where to place it, and which usings are necessary. Because, honestly, I've tried to piece this together every which way and have read all the StackOverflow articles, without success.
You know what? Just forget it. I've changed my project from .Net Core to .Net Framework. For one thing, I tried also creating a .Net Core project configured for database connectivity. And that introduced Entity Framework, which is the most obnoxious thing ever. .Net Core, with all of its DI and its nested parentheses constructs, is the most obtuse looking code I've ever seen. And then the documentation stinks, and the incomplete code examples get you nowhere. .Net Core is like evolution in reverse.