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:

Refactoring Bloated Code in C#

In this article, we will learn what anti-patterns belong to the group of code smells called bloaters and different techniques for refactoring bloated code in C#. [sc name="github"...

How to Execute CLI Applications From C#

In this article, we will learn how to execute CLI applications in C# using a built-in class called Process and using open-source libraries. We will cover how we can execute CLI, how we can check if the CLI execution was successful, and how we can react to the...

Method Overriding in C#

Method overriding in C# is a form of implementing polymorphism. We also call it "run-time" polymorphism. In this article, we are going to learn more about method overriding, how to implement it, and how it differs from method overloading. [sc name="github"...

How to Implement Checkbox List in ASP.NET Core

A Checkbox List is an important feature to encourage multiple selections of inputs in forms. We will start with a brief overview of the existing checkbox functionality in ASP.NET Core and later on move to the implementation of a checkbox list.  [sc name="github"...

How to Get an Enum Member as a String in C#

In this article, we're going to learn how to get a string representation of an enum member in C#. The possibility of defining enumeration types in C# - most widely known by the keyword enum - is a very useful feature. We can use them to assign named constants that...

Check If a String Array Contains a Value and Get Index

In this article, we are going to see the different ways we can check for a specific value in a string array and return the index of that value. We will focus mainly on linear search methods. We cannot use binary search methods since we do not know if the array is...

Required Members in C#

 C# 11 introduces the concept of required members. Any code instantiating the containing class must initialize these members; otherwise, the compiler will issue an error while compiling it. In this article, let's learn how to use this feature to prevent bugs and catch...

How to Randomize a List in C#

C# has several built-in methods for working with arrays and lists, but what if you need to randomize a list of items? In this article, we'll look at some techniques we can use to randomize lists in C#. We'll also discuss some of the pros and cons of each technique and...

How to Get The List of Properties in C#

In this article, we are going to learn how to get the list of properties in C#, and also how to use the BindingFlags to filter the properties to retrieve. [sc name="github"...

Convert String and Int to Enum in C#

In this article, we’re going to look at how to convert a string and int to an enum in C#. Enums allow us to declare a group of related constant values in a readable way where the underlying data type is usually an integer.  [sc name="github"...

Boxing and Unboxing in C#

In this article, we are going to talk about boxing and unboxing in C#.  When we work with C# language constantly, we need to...

Encrypting and Decrypting a String in C#

In this article, we will learn how encrypting and decrypting a string is done using C# and the Cryptography package that comes included with .NET. [sc name="github"...

Generic Attributes in C#

In this article, we are going to learn how generic attributes help us implement better custom attributes through a practical example. [sc name="github" url="https://github.com/CodeMazeBlog/CodeMazeGuides/tree/main/csharp-advanced-topics/GenericAttributesInCSharp"...

How to Iterate Over JSON Objects in C#

Manipulating JSON objects is a common operation in applications. In this article, we will look at different ways of iterating over JSON objects in C#. [sc name="github" url="https://github.com/CodeMazeBlog/CodeMazeGuides/tree/main/json-csharp/IteratingOverJsonObject"...

ConcurrentBag in C#

In C#, there are many classes that we can use to represent a group of objects that we may manipulate concurrently using multiple threads. One such class is the ConcurrentBag<T>. In this article, we will learn how to add, access, and remove elements from a...