Re:.NET Core 3.0 Concludes the .NET Framework API Porting Pr...
by noderat on Tuesday October 15, 2019 @10:31AM
(#21258780)
I really wish the documentation for things like DI, IOptions and ILogger were moved out of the ASP.NET documentation. Trying to decipher from the documentation how to use these in a non-ASP.NET project is needlessly complicated.
Re:.NET Core 3.0 Concludes the .NET Framework API Porting Pr...
by WorldMaker on Tuesday October 15, 2019 @04:13PM
(#21263186)
It's getting pushed out of ASP.NET with the "Generic Host" efforts. It's still for the time being in ASP.NET documentation, but you see it's moving in that direction.
https://laurentkempe.com/2019/09/03/WPF-and-dotnet-Generic-H...
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/ho...
Re:.NET Core 3.0 Concludes the .NET Framework API Porting Pr...
by thomasz on Tuesday October 15, 2019 @08:36AM
(#21257727)
The asp configuration thing is complicated but powerful. If you don't want that, you can just use ``Environment.GetEnvironmentVariable`` and be done with it.
Re:.NET Core 3.0 Concludes the .NET Framework API Porting Pr...
by shhsshs on Tuesday October 15, 2019 @08:42AM
(#21257759)
Plus it’s barely any extra work to load settings from environment variables. And it lets you write code agnostic to where the settings are coming from, and then choose to load them from environment variables, a file, hard coded values, etc.
Makes testing easier too because you don’t have to write a fixture around your settings. Just build the class with known setting values without writing code purely for testing.
Static using directives! Certainly a useful tool, thank you. I had been away from the .Net universe for a while and I think I have some more catching up to do. Some of the newer changes in C# help a lot with reducing code heft, even though it makes the language more complex.
However, the Framework seems to be headed in the opposite direction when it comes to simplicity. Here's for example the IOptions pattern: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/co...