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...
Code Maze Weekly #148
Issue #148 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks Stop using trivial Guard Clauses! Try this instead [codeopinion.com] Guard clauses are considered to be useful, but are they...
Using Dynamic LINQ With System.Linq.Dynamic.Core Library
In most applications, we query data from a source, a database, for instance, and perform operations on that data. For this, we use can use LINQ. However, when we want to unlock more powerful features of the C# language, we use the System.Linq.Dynamic.Core library. In...
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...
How to Use the “Using Static” Feature in C#
In this article, we're going to learn about the using static directive feature in C#. Let's dive in. What Is a “using static” Directive? In...
How to Return null From a Generic Method in C#
In this article, we are going to learn about how we can return null from a generic method in C#. Let's start. Can We Return null From a...
Code Maze Weekly #147
Issue 147# of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks .NET 7 is Available Today [devblogs.microsoft.com] That time of the year has come. Of course, we're talking about .NET 7 release...
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.
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#
In this article, we are going to take a look at the HashSet class in C#. We will discuss how to use it and its key features. Also, we are going to see some examples of how to use it in practice. Finally, we'll compare it to other data structures available in C#. Compact but packed with information article about creating ASP.NET Core Web API applications by...
Dictionary vs Hashtable in C#
In this article, we are going to compare Dictionary and Hashtable in C#. We will start with a brief introduction to both data structures and then proceed to the comparison. [sc name="github"...
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...
IComparable vs IComparer vs Comparison Delegate
In this article, we're going to learn about the IComparable and the IComparer interfaces, and the Comparison delegate. In C#, if we have an array of types such as integers or strings, it supports inbuilt comparison and sorting. This is because it implements the...
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...