I posted my previous simple string concatenation benchmark results where I was concatenating my name with spacer on Reddit recently. … Continue reading Simple string concatenation using String.Create and other performance sensitive approaches in .NET 8
I post .NET / C# and Visual Studio content on LinkedIn and Twitter almost daily. Please consider following me. LinkedIn … Continue reading Please follow me on Twitter and LinkedIn for more .NET content
Do we rely too much on third party libraries from NuGet? Are we exposing our clients to risks here by … Continue reading Do .NET developers rely too much on third party libraries from NuGet?
I took this Twitter poll recently to gauge how many devs were thinking of moving away from Moq after the … Continue reading Poll Results : Are many .NET devs moving away from Moq after #moqgate?
Dear .NET friends, how do you like to create your mocks? 🤔 …With a framework like Moq or manually? I … Continue reading Do you use a mocking framework or manually create your mocks?
Warnings are too easy to ignore. Consider treating all warnings as errors by setting the TreatWarningsAsErrors property to true in … Continue reading How to treat all warnings as compile errors in .NET
To set properties for every project in a directory in a centralized location create a Directory.Build.props file in your solution … Continue reading Share settings across multiple projects using a Directory.Build.props file
I was wondering recently which .NET mocking library is most popular. I suspected Moq but ran a poll to find … Continue reading Poll Results : What .NET mocking library do you use?
I love parameterized tests. Instead of many different test methods with different inputs set in the method body we have … Continue reading How to create Parameterized Tests with xUnit
Which .NET mocking library syntax do you prefer from the below test examples? Moq?NSubstitute?FakeItEasy? … and which library do you … Continue reading Moq, NSubstitute and FakeItEasy mocking library syntax comparison
Just for fun, I took benchmarks using BenchmarkDotNet to see what’s the fastest out of common ways used to concatenate … Continue reading .NET 8 simple string concatenation benchmarks
There’s some awesome string comparison OrdinalIgnoreCase improvements coming in .NET 8, although I did see one regression too. Click on … Continue reading String.Equals with OrdinalIgnoreCase faster in .NET 8 compared with .NET 7
Instead of calling your benchmark methods outside the context of BenchmarkDotNet to validate they all return the same value, let … Continue reading How to validate all benchmarked methods return the same value with BenchmarkDotNet
By default BenchmarkDotNet outputs the results of benchmarks as they are coded in the benchmark class file. If you wish … Continue reading How to order BenchmarkDotNet results from fastest to slowest
.NET 8 Preview 5 was recently released and it includes improvements to ASP.NET debugging in Visual Studio. It looks like … Continue reading Improved ASP.Net debugging in Visual Studio in .NET 8
For those that don’t know Microsoft have introduced new FrozenDictionary and FrozenSet collections in .NET 8 (from Preview 1). These collections … Continue reading .NET 8 FrozenDictionary benchmarks
C# Tip 💡 ->Did you know LINQ Intersect can be used to find common items between two collections in .NET? … Continue reading Use LINQ Intersect method to find common items in two collections in .NET
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
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?
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
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
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
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
.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
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?