Cache invalidation is hard, but if the data allows, using low TTLs can simplify it by automatically expiring cached items … Continue reading .NET Caching: Can a One Second Cache Really Make a Difference?
Category: .NET Core Blog
Implementing HybridCache with FusionCache v2 in .NET 9
FusionCache v2 is the very first production-ready implementation of Microsoft HybridCache, including Microsoft’s own which is currently still in preview. … Continue reading Implementing HybridCache with FusionCache v2 in .NET 9
How to install Scalar in .NET 9
I’m guessing you know what Scalar is if you’ve arrived here so let’s just look at the code to implement … Continue reading How to install Scalar in .NET 9
How to add SwaggerUI back into a .NET 9 Web API project
Swashbuckle.AspNetCore (including SwaggerUI) has been removed from the Web API template in .NET 9. Since the Swashbuckle project is being … Continue reading How to add SwaggerUI back into a .NET 9 Web API project
Numerical StringComparer coming in .NET 10
This enables comparisons of numbers based on their numerical value instead of lexicographical order. In the example below with Ordinal … Continue reading Numerical StringComparer coming in .NET 10
ASP.NET IOptions pattern example
IOptions<T> gives us compile-time safety and eliminates magic strings.Simple example below : Click on the image for a larger view … Continue reading ASP.NET IOptions pattern example
ASP.NET Rate Limiting middleware simple examples
Since .NET 7, ASP.NET has built-in middleware for rate limiting our API endpoints. Once we understand the different rate limiting … Continue reading ASP.NET Rate Limiting middleware simple examples
.NET 10 will support OpenAPI v3.1
Safia from Microsoft posted this on BlueSky recently … This is great news but based on what she also posted … Continue reading .NET 10 will support OpenAPI v3.1
Simple string concatenation using String.Create and other performance sensitive approaches in .NET 8
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
Please follow me on X/Twitter and LinkedIn for more .NET content
I post .NET / C# and Visual Studio content on LinkedIn and X/Twitter almost daily. Please consider following me. LinkedIn … Continue reading Please follow me on X/Twitter and LinkedIn for more .NET content
Do .NET developers rely too much on third party libraries from NuGet?
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?
Poll Results : Are many .NET devs moving away from Moq after #moqgate?
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?
Do you use a mocking framework or manually create your mocks?
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?
How to treat all warnings as compile errors in .NET
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
Share settings across multiple projects using a Directory.Build.props file
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
Poll Results : What .NET mocking library do you use?
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?
How to create Parameterized Tests with xUnit
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
Moq, NSubstitute and FakeItEasy mocking library syntax comparison
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
.NET 8 simple string concatenation benchmarks
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
String.Equals with OrdinalIgnoreCase faster in .NET 8 compared with .NET 7
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
How to validate all benchmarked methods return the same value with BenchmarkDotNet
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
How to order BenchmarkDotNet results from fastest to slowest
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
Improved ASP.Net debugging in Visual Studio in .NET 8
.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
.NET 8 FrozenDictionary benchmarks
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
Use LINQ Intersect method to find common items in two collections in .NET
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