cover

Throw vs. Throw ex - Back to the basics

This is another article in the “Back to the basics” series. The first part covered Boxing and UnBoxing, today we’ll look at the difference between throw and throw ex. 💁...

Approval test for your public API

Are you developing a .NET library and want to make sure that the public API of your library is always consistent and versioned correctly? How do you check that changes...

ASP.NET Core - Rate limiting

Rate limiting is a technique used mainly with APIs to control and limit the number of requests that clients can make to the API in a defined time. It belongs...

AZURE Service Bus - How we didn’t use Topic filters

When developing microservices, you are likely to encounter the need for a message broker. A reliable system for sending messages between services. We at KROS a.s. have decided to use...

C# 12 news that didn’t make it into separate posts

C# 12 has been released November 2023. I’ve written separate articles about each of the new features: C# 12 - Primary constructor C# 12 - Collection expressions Simplify tuple types...

Testing with properties using FsCheck

I assume that most of us use a technique called example-based testing when writing unit tests. This technique is based on writing tests that verify the behavior of our functions...

Boxing & UnBoxing - Back to the basics

Unless you know what Boxing and UnBoxing (no UnBoxing is not fancy unboxing a new iPhone by your favorite youtuber) is, don’t read this post. In all likelihood, you won’t...

Test your architecture with NetArchTest

Do you have an architecture type defined on the project? Onion / Clean / Vertical Slice / … architecture? Or do you have your own architecture rules? How do you...

Simplify tuple types using aliases

Are you a fan of functional programming, or do you just like using tuple types? In that case your code might look something like this: static (decimal score, string grade)...

Time travel with TimeProvider

If you write unit tests you know that using DateTime.Now directly is not a good idea 🤔. You probably have something like IDateTimeProvider or something similar in your project. 🌠...

WireMock.NET

❓ How do you write unit/integration tests for functionality that depends on a third party API? We at KROS a.s. use WireMock.NET library, which elegantly allows you to create a...

Multi-Tenant Output Cache Policy

🚀 ASP.NET Core Output Cache for MultiTenancy Services In the previous post, I showed how to use the ASP.NET Core output cache. I mentioned that it is not sutible for...

Output cache with ASP.NET Core

🚀 Speed up your API with output caching. ASP.NET Core since version 7 offers outcaching out of the box. Just use the AddOutputCache method to add configuration to the DI...

Stryker.NET

💡 #unittest #tip - Test your tests with #stryker How do you verify the quality of your unit tests? Do you use code coverage metrics or something else? A good...

C# Puzzles

Happy New Year fellow dotnet developers! 🎆 Kickstart 2024 with the C# challenge. I have prepared 5 interesting (not entirely useful 🙂) C# puzzles. Can you solve some of them?...