New Guard Clauses coming in .NET 8 👇🏻 … .NET 6 and .NET 7 introduced a couple of Guard Clauses … Continue reading New Guard Clauses coming in .NET 8
Category: .NET Core Blog
Poll Results : Do you enable Nullable Reference Types in your C# 8+ .NET apps?
Nullable Reference Types are supported since C# 8 in .NET and allow us to minimize the likelihood that our code … Continue reading Poll Results : Do you enable Nullable Reference Types in your C# 8+ .NET apps?
NuGet website now allows filtering of packages by .NET target framework
FYI … the NuGet website now allows you to filter by .NET target frameworks. Useful? What do you think? You … Continue reading NuGet website now allows filtering of packages by .NET target framework
Treat Nullable references type warnings in C# 8+ as errors
To treat Nullable reference types (C# 8) warnings as errors to ensure they aren’t just ignored add line 7 below … Continue reading Treat Nullable references type warnings in C# 8+ as errors
How to set C# 10+ file scoped namespaces as default in Visual Studio
If you’re using Visual Studio 2022 & want to use File-scoped namespaces (C# 10+) by default when you create a … Continue reading How to set C# 10+ file scoped namespaces as default in Visual Studio
.NET Framework 4.8 v .NET 7 simple ADO.NET select performance benchmarks
I love it when an upgrade to the underlying .NET framework results in faster code without us actually having to … Continue reading .NET Framework 4.8 v .NET 7 simple ADO.NET select performance benchmarks
ASP.NET route syntax colour highlighting coming in .NET 8
.NET 8 will have route syntax colour highlighting for all routes including those in minimal APIs, MVC, Web APIs, Razor … Continue reading ASP.NET route syntax colour highlighting coming in .NET 8
Poll Results : What do devs use for DB CRUD in their .NET apps?
I asked .NET devs what they used for DB CRUD in most of their apps on my LinkedIn and Twitter … Continue reading Poll Results : What do devs use for DB CRUD in their .NET apps?
.NET Framework 4.8 v .NET 7 reflection performance benchmarks
Just for fun I ran a BenchmarkDotNet comparison between .NET Framework 4.8 and .NET 7 for some reflection related functionality … Continue reading .NET Framework 4.8 v .NET 7 reflection performance benchmarks
How to spilt a collection into sub collections of a certain size in .NET 6+ using the LINQ Chunk method
FYI, in .NET 6+ the Chunk LINQ method is useful for splitting up sequences into sub sequences of a certain … Continue reading How to spilt a collection into sub collections of a certain size in .NET 6+ using the LINQ Chunk method
.NET 7 increment operator ++ and +1 compiling differently
Since they are equivalent ++ and +1 should compile to the same code, right? As we can see below, this … Continue reading .NET 7 increment operator ++ and +1 compiling differently
Benchmark custom code workarounds against each new version of .NET as the framework gets faster all the time
Always revisit and benchmark your custom code workarounds with each version of .NET. The .NET framework and the JIT compiler gets faster … Continue reading Benchmark custom code workarounds against each new version of .NET as the framework gets faster all the time
Use new StringSyntax Attribute in .NET 7 to give semantic meaning to strings
FYI… the StringSyntax Attribute is new in .NET 7 and allows us to tell Visual Studio what kind of string … Continue reading Use new StringSyntax Attribute in .NET 7 to give semantic meaning to strings
.NET ChatGPT example – API controller using injected repository and DTO mapped to model using explicit operator
I love ChatGPT and previously posted an example of some ChatGPT generated code to create a controller, with DTO and … Continue reading .NET ChatGPT example – API controller using injected repository and DTO mapped to model using explicit operator
ChatGPT generated .NET CRUD controller with DTO mapped to domain model using AutoMapper
It’s not perfect but I’m absolutely loving ChatGPT. ChatGPT-3 (current version as of writing) is trained on 175 billion parameters, … Continue reading ChatGPT generated .NET CRUD controller with DTO mapped to domain model using AutoMapper
String + versus StringBuilder benchmarks for 50K one char concatenations in .NET 7
I’m sure there’s still some junior .NET devs using + to concatenate large (usually an unknown) amounts of strings? Look … Continue reading String + versus StringBuilder benchmarks for 50K one char concatenations in .NET 7
Poll Results : Will you use .NET 7 in production even though it’s not an LTS release
.NET 7 was released in November (2022) and includes a lot of awesome new features and performances improvements. It is … Continue reading Poll Results : Will you use .NET 7 in production even though it’s not an LTS release
ASP.NET application output now available in integrated Visual Studio window
FYI… in the latest Visual Studio 2022 preview (version 17.5 Preview 2) we can view the application output for ASP.NET projects … Continue reading ASP.NET application output now available in integrated Visual Studio window
.NET nostalgia – Wrox .NET books from the 2000s and 2010s
Who remembers the big red Wrox books which were popular in the mid 2000s and early 2010s? Wrox used to … Continue reading .NET nostalgia – Wrox .NET books from the 2000s and 2010s
.NET 8 alpha version available on GitHub.com/dotnet
For the real .NET nerds amongst us the .NET 8 alpha version installer is available on GitHub.com/dotnet/installer. To see what’s … Continue reading .NET 8 alpha version available on GitHub.com/dotnet
Poll Results : Do you put MediatR command/query and related handler in same file?
Personally I think MediatR can add unneeded complexity to a project but when using it one thing I like to … Continue reading Poll Results : Do you put MediatR command/query and related handler in same file?
How to select BenchmarkDotNet benchmark in the console at runtime
If you have a set of benchmarks and are looking to run different ones at different times you can manually … Continue reading How to select BenchmarkDotNet benchmark in the console at runtime
String.Replace performance improvements in .NET 5 v .NET 6 v .NET 7
It’s amazing to see the performance improvements of String.Replace across multiple versions of .NET 🚀🚀🚀🚀. When you have such a … Continue reading String.Replace performance improvements in .NET 5 v .NET 6 v .NET 7
.NET 7 has string concatenation related performance regressions
I quite often post about performance improvements from one version of .NET to another BUT sometimes performance regressions happen. I … Continue reading .NET 7 has string concatenation related performance regressions
Poll Results : What IDE do .NET developers use mostly?
I ran a poll on my LinkedIn and Twitter profiles recently wondering if Rider or Visual Studio was used more? … Continue reading Poll Results : What IDE do .NET developers use mostly?