2024, Sep 7th

Want Better Unit Tests with In-Memory Databases?

Developing .NET applications that interact with relational databases requires robust unit tests. While mocking is a common approach, it may not always accurately represent real-world database behavior. Using in-memory databases like SQLite for these tests offers several advantages: It’s important to note that unit tests with in-memory databases do not replace integration tests but complement your testing strategy. In this article, we’ll explore: SQLite Challenges: […]

2024, May 19th

Threads: Is Better Use it or Not?

In the world of .NET development, threads are powerful tools that enable the simultaneous execution of multiple tasks. However, deciding whether or not to use them in your project can be a challenge. To help you make this informed decision, this post will explore the pros and cons of using threads, providing you with a comprehensive overview of the landscape. Additionally, we’ll delve into a […]

2024, Apr 13th

C# Benchmark: StringBuilder vs. GenericList. Which one is the best?

I came across discussions claiming that GenericList might outperform StringBuilder in certain scenarios. Intrigued by this, I decided to conduct a benchmark to clarify the matter and learn more about it. Benchmark setup code Without spending your time, below is the Benchmark setup code. I’ve also uploaded it on GitHub: https://github.com/eliasedc/BenchmarkString YES! Just for fun, I’m also running a test on the native ‘string’ class. […]

2023, Dec 4th

How to Solve 500 – Internal Server Error in C# .NET Framework / .NET Core REST Requests – When Postman Works, But Your Code Falters

In general, a 500 – Internal Server Error isn’t a client-side problem. However, if your requests work on Postman or another API platform for developers, and you don’t have control over the server-side, you may need to adjust your app’s request to make it work as well. Summary 1 – Without further ado, I will demonstrate what resolved a 500 – Internal Server Error that […]