2 ms·
> ASP.NET Core does push you strongly towards dependency injection, but it does not force you at all to use it. Their own documentation for making queries agai
by FridgeSeal 6y ago
> ASP.NET Core does push you strongly towards dependency injection, but it does not force you at all to use it.
Their own documentation for making queries against SQL Server doesn't provide examples of how to do it that aren't using DI. "Just inject it" it just says. Thanks .net, super helpful. Maybe the docs are there, but I couldn't find them at all when I went looking.
- mattmanser 6y agousing(var conn = new SqlConnection("<conn-string>")) using(var cmd = new SqlCommand(@"Query here", conn)) { conn.Open(); cmd.executeNonQuery(); }
- FridgeSeal 6y agoHmmmm, maybe I am just dense hahaha.