StringBuilder Class in C#

Stringbuilder class in C#

When I learned to program, my professor told me that the String class is immutable. That means you cannot change the memory of that string. A new memory allocation happens whenever you try to modify a string. Use StringBuilder instead of String operators When I was a junior programmer, I used string operators whenever I needed to concatenate two strings. … Read more

WebP Images in C# and ASP.NET

nature image webp format

What is a WebP image? WebP is a new format for images developed by Google, which offers more efficient compression rates (up to 34% smaller) than the old formats like PNG and JPEG. Most websites load many big images. The speed of the website is slow. As a result, the traffic is impacted. All of my websites use this format … Read more

Background Tasks using Hangfire

Hangfire library

What Is Hangfire? Hangfire is a library that allows you to run scheduled tasks in the background without the interaction of the UI thread. This library is similar to CRON jobs or the SQL Server Agent so that you can schedule different tasks. Millions of projects use it, and it’s free. A premium version is also available if you need batches, … Read more

C# Parallel Foreach and Parallel Extensions

Parallel Class

The Parallel class was introduced in .Net Framework 4.0 and can run for and foreach loops in parallel. Parallel Class The Parallel class has three static methods: For – you can iterate collections in parallel using an index Foreach – this is the most used because you specify the collection and body of each loop. Invoke – you can use … Read more

Dapper – The Alternative ORM

Dapper ORM

Dapper is the best alternative for Entity Framework, and in many situations, it is better. In this article, I will explain why Dapper it’s my favorite ORM. If you think that Dapper is not suitable for you, consider that Stack Overflow uses. Dapper vs Entity Framework The most significant difference between these two is that you write SQL queries instead … Read more