Code Maze Author

Code Maze

This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.
Also find me here:



MY ARTICLES:

HashSet vs SortedSet in C#

The HashSet<T> and SortedSet<T> classes in the System.Collections.Generic namespace define two ways of storing and iterating over a collection of objects in C#. Both classes have pros and cons, so which one should we use? This article is going to compare...

System.Linq.Dynamic.Core: Dynamic LINQ in C#

System.Linq.Dynamic.Core lets us write LINQ queries as strings. Where typed LINQ takes a lambda, Where(e => e.Department == "IT"), the library takes text, Where("Department == @0", "IT"), and parses it into the same expression tree. We need that when the shape of a...

How to Manage IDisposable Objects in C#

In this article, we are going to learn about IDisposable objects and how to manage them in C#. While developing applications in C# or any...

Null-Coalescing ?? And Null-Coalescing Assignment ??= Operators in C#

In this article, we are going to find out what null-coalescing operator ?? and null-coalescing assignment ??= operators are and how to use them. [sc name="github" url="https://github.com/CodeMazeBlog/CodeMazeGuides/tree/main/csharp-operators/NullCoalescingOperator"...

SortedSet in C#

A SortedSet in C# is a data structure that allows us to store and access elements in sorted order. In this article, we are going to explore how to create and use the SortedSet class in C#. We are also going to look at some of the benefits and drawbacks of using this...

How to Use HTML Agility Pack in C#

In this article, we're going to learn how to use HTML Agility Pack in C# and review some examples of its most important features. ...

Tasks vs Threads in C#

In this article, we are going to look at the main differences between Tasks and Threads. They are both used for concurrent programming, but Tasks were later introduced with .NET Framework 4. [sc name="github"...

Concurrent Collections in C#

Concurrent Collections in C# are a set of collections designed for synchronized multi-thread access. We can find concurrent collections under the System.Collections.Concurrent namespace. Nowadays, where it is getting increasingly important and accessible to work in a...

HashSet in C#: Methods and Set Operations

A HashSet<T> in C# is a collection that holds each value at most once and finds any of them in constant time on average. Adding a value that is already in the set changes nothing and tells us so. [sc name="github"...

How to Convert DataTable to JSON in C#

Converting DataTable to JSON is one of those tasks that we come across from time to time and it seems like there should be a built-in method to do it. Unfortunately, that is not the case and we need to figure out a way to do it on our own. In this article, we will...

Constructor Overloading in C#

In this article, we are going to talk about constructor overloading in C#. We'll look at the different ways to implement it in an application.  While we look at constructor overloading in this article, we have an existing article on constructors that can act as a...

Using OData with ASP.NET Core Web API

In this article, we will learn how to use OData with ASP.NET Core Web API services. OData (Open Data Protocol) is an open protocol that defines a set of best practices for building and consuming RESTful APIs. Initiated by Microsoft in 2007, it has become an OASIS...

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. ...

Capitalize the First Letter of a String in C#

To capitalize the first letter of a string in C#, upper case the first character and copy the rest unchanged. string.Create() does it in a single allocation: string.Create(input.Length, input, static (chars, str) => { chars[0] = char.ToUpperInvariant(str[0]);...