C# Explicit Operator example to map from one type to another

In .NET we have plenty of ways to map objects to one another. Below is an example, courtesy of ChatGPT of using the EXPLICIT OPERATOR 👇🏻. How do you like to convert objects from one type to another? AutoMapper? Mapster? Plain left-right assignment perhaps using the Explicit Operator or Extension methods? The words are often … Continue reading C# Explicit Operator example to map from one type to another

C# – How to check if an item exists in a list

In this article we’ll present and compare two functions which offer us a possibility to check whether an item exists in a given list. These functions are Exists and Contains, both available in System.Collections.Generic namespace. Provided examples are for two different lists: one containing integers and other one containing objects of custom created class. List … Continue reading C# – How to check if an item exists in a list

C# – How to initialize an array

Array is a fixed size collection of variables representing the same type. Array can store both built-in primitive types (like integer) and custom objects. In this article we’ll present different ways of initializing such arrays. Array of integers Let’s consider an array of integers. Below are presented five different methods of creating 3 elements array, … Continue reading C# – How to initialize an array