How to Use ModelState Validation in ASP.NET Core Web API
In this article, we are going to talk about what is ModelState validation, why, and how to use it in ASP.NET Core. We always strive to separate...
Quicksort Algorithm in C#
Quicksort is one of the most efficient algorithms that we can use to accomplish our sorting goals. In this article, we discuss how to implement Quicksort in C# as well as analyze its time and space complexity. To download the source code for this...
Serialization and Deserialization in C#
In this article, we’re going to explore the different flavors of serialization and deserialization in C#. Let’s dive into it. What Is Serialization and...
StringBuilder in C#
In this article, we are going to talk about StringBuilder in C#. Let's dive in. What is StringBuilder in C#? The string type is immutable in C#, so we cannot...
Compare Arrays in C#
There are many different ways to compare arrays in C#. In this article, we are going to cover many of them, check some differences between each approach, and inspect a benchmark result for the fastest technique. To download the source code for this...
Optional Parameters in ASP.NET Core Web API Routing
In this article, we are going to look at how to use optional parameters in ASP.NET Core Web API routing. Additionally, we are going to learn how to use optional parameters with route constraints. To download the source code for this article, you can...
Code Maze Weekly #116
Issue #116 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Performance benefits of sealed class in .NET [www.meziantou.net] Gérald Barré gives us a nice insight into the performance benefits of using sealed classes. Real-World...
In-Memory Caching in ASP.NET Core
In this article, we are going to talk about the caching basics and how to implement In-Memory Caching in ASP.NET Core applications. Let's start. [sc...
How to Write a JSON Into a File in C#
In this post, we are going to learn how to write a JSON into a file in C#. JSON is structured, lightweight, widely supported, more readable, and more efficient...
Remove Time From a DateTime Object in C#
When we need to work with time in C# we use the DateTime type. DateTime values have two components, as easily inferred from the name - a date part and a time part. Since in some cases we might need only one part out of the two, in this article we're going to learn how...
Health Checks in ASP.NET Core
In this article, we are going to look into Health Checks in ASP.NET Core. Then we are going to look into the Health Checks Middleware provided by ASP.NET Core to create some checks and add a nice dashboard to view all our Health Checks. Finally, we will briefly look...
How to Sum Up Elements of an Array in C#
A frequent question in .NET interviews is about operations using arrays. In this article, we are going to learn how to sum up elements of an array in C#. After studying the different techniques, we are going to build a performance benchmark and check which one is the...
Using Variables Inside Strings in C#
In this article, we are going to explore how to use variables inside strings in C#. There are a few ways to accomplish that, depending on the C# version being used. To download the source code for this article, you can visit our GitHub...
Merge Sort in C#
Merge sort in C# is one of the algorithms that we can use to sort elements. Merge Sort is known to be efficient as it uses the "divide and conquer" strategy that we are going to discuss as we implement it. To download the source code for this...
Code Maze Weekly #115
Issue #115 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# How to send ASP.NET Core Identity emails with Twilio SendGrid [swimburger.net] ASP.NET Core provides mechanisms to confirm emails and reset passwords, but it's up to us...
How to Deserialize a Complex JSON Object in C# .NET
Serializing and deserializing JSON objects are an important part of all software engineer routines. In this article, we will learn different techniques about how to deserialize a complex JSON object in C# and check, with a performance benchmark, which is the fastest...
Types of Inheritance In C#
In this article, we are going to describe the types of inheritance in C# and their use in various scenarios. Let's dive in. What is Inheritance in C#? The...
How to Remove Elements From a Generic List in Iteration With C#
In this article, we are going to look at different ways to remove elements from a generic list while iterating through it. If we try simply to do a test and...
How to Serialize Enum to a String in C#
In this article, we are going to learn how to serialize enum to a string in C#. In C#, JSON serialization very often needs to deal with enum objects. By default,...
Queue in C#
Queue in C# is a very useful collection for the data which we need to handle with first-in, first-out order. In this article, we are going to cover the main concepts of Queues in C#. To download the source code for this article, you can visit our...
C# 10 New Features
In this article, we are going to take a look at what's new in C# 10. .NET 6 supports the latest C# version, and to use it in our projects, we will need the latest .NET 6 SDK or Visual Studio 2022 which includes the SDK. To download the source code...