Code Maze Weekly #144
Issue #144 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks ASP.NET Core: Three ways to refresh the claims of a logged-in user [www.thereformedprogrammer.net] If you want to learn about the three different ways to...
Common C# Programming Mistakes
In this article, we are going to look at some common C# programming mistakes. We are pretty sure that there are a lot more mistakes that developers make while writing their projects, but here, we will try to summarize the ones we often noticed while working with other...
Localization in ASP.NET Core
Making websites multi-lingual allows users from around the globe to use our applications in their native language. In this article, we are going to see how ASP.NET Core provides us with the ability to enable localization to support different languages and cultures. ...
Make The First Letter of a String Upper Case in C#
In this article, we're going to take a look at how to make the first letter of a string upper case in C#. We'll see some different approaches and investigate their performance characteristics. By the end of this article, we should have a good understanding of which...
Code Maze Weekly #143
Issue #143 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks Add MS SQL Server JSON Support To Entity Framework Core [khalidabuhakmeh.com] Many software developers use Entity Framework Core with MSSQL daily, but not too...
What is IndexOutOfRangeException in C#?
In this article, we are going to learn about one of the most common exceptions in C# - IndexOutOfRangeException. We're going to...
Boosting Performance With Sealed Classes in .NET
In this article, we are going to learn how we can boost performance with sealed classes in our .NET projects. By default, all classes in C# are open for inheritance. We can use the sealed keyword to prevent inheriting from the class and improve performance for certain...
Performance Testing of ASP.NET Core APIs With k6
In this article, we are going to discuss how to do ASP.NET Core Performance Testing, specifically with the open-source tool k6. We'll cover the need for performance testing, how to get the best results, and then dive into some examples of how k6 can help. Everyone loves LINQ. It's one of the best additions .NET ever got, so make...
Path Class in C#
When we want to perform operations on path strings containing file or directory path information, the best choice is to call the built-in C# Path Class methods. This class comes under the System.IO namespace and System.Runtime.dll assembly. In this article, we are...
What is .NET – Why Should We Use It, and What Can We Do With It
In this article, we are going to learn about .NET and its capabilities. We'll see what .NET is, what different application models .NET supports, why should we use it, and some limitations. So let's get going. What is .NET? .NET is a free, cross-platform, open source...
What is the Difference Between a DTO and a POCO?
In this article, we are going to learn the differences between a DTO (Data Transfer Object) and a POCO (Plain Old CLR/C# Object). We use these types of objects in everyday coding. However, we are often not sure what the real differences are. We are going to dive...
Code Maze Weekly #141
Issue #141 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks ASP.NET Core rate limiting middleware in .NET 7 [blog.maartenballiauw.be] With .NET 7 we're finally getting the in-build rate-limiting middleware. Let's see...
How to Read AppSettings Values From a JSON File in .NET Core
In this post, we are going to learn how to read AppSettings values from a JSON file in ASP.NET Core. Let's start. If you ever need to take the site offline for maintenance, here's a...
Using Query String Parameters with Minimal APIs
In this article, we are going to explain how we can work with query string parameters in Minimal APIs in .NET 6. You may refer here for a nice introduction to the concept of Minimal APIs. Also, we will show new improvements that .NET 7 brings to the table. [sc...
AutoMapper vs Mapster in .NET
In this article, we are going to compare the popular object mapping libraries AutoMapper and Mapster. Later, we'll do a performance benchmark to find the most performant one. [sc name="github"...
What is NullReferenceException in C#?
In C#, a NullReferenceException occurs when we try to access a variable whose value has not been set or has been set to null. It can be easy to trigger this exception accidentally, so it's important to be aware of how to avoid it in the first place. In this article,...
FileSystemWatcher in C#
.NET provides a handy way to deal with monitoring different file system changes. In this article, we will discuss what FileSystemWatcher is, how to set it up, and how to configure it to observe various file system changes. In addition, we will take a look at the...