Type Checking and Type Casting in C#
In this article, we are going to learn various ways of converting a value from one type to another (type casting) and how to check the type of a value at run time (type checking). [sc name="github"...
MY ARTICLES:
In this article, we are going to learn various ways of converting a value from one type to another (type casting) and how to check the type of a value at run time (type checking). [sc name="github"...
In this article, we are going to learn how to sort the values in the dictionary by their value. Let's begin. Sorting by Value in...
In this article, we will look at how to handle unexpected errors in Blazor WebAssembly using Error Boundaries. Let's dive in. Exception Handling in...
In this article, we will discuss the new LINQ improvements introduced in .NET 6. We will not talk about the LINQ itself because we already have an article on that topic. [sc name="github"...
In this article, we are going to cover six different ways to concatenate lists in C#. After learning about every approach, we are going to evaluate some benchmarks to find out which is the most efficient approach. [sc name="github"...
In this article, we are going to be learning how to implement Lucene.NET in C#. We will cover the entire process from installing the library, to indexing and searching. [sc name="github"...
In this article, we are going to deal with a special case of JSON processing, polymorphic serialization, and deserialization with System.Text.Json. The introduction of the System.Text.Json package has given .NET developers another powerful option for JSON format...
In this article, we are going to learn how to convert a string array to a string in C#. We will cover five different approaches to achieve the same result, and in the end, we will inspect benchmark results to see the fastest way to accomplish the conversion. [sc...
In this article, we will learn how to merge arrays in C#. This functionality will allow us to combine two or more arrays. Working with arrays is essential when performance matters to us since arrays work faster than many other data structures. We will use different...
In this article, we will learn about how to Base64 encode and decode in C#. Let’s dive in. What is Base64 Encoding? Base64 are symbols...
In this article, we're going to learn about cookie authentication with ASP.NET Core and Angular. We'll create an ASP.NET Core Web API with sign-in, sign-out, and a protected user endpoint for demonstration. In Angular, we'll access the protected user endpoint after...
In this article, we’re going to learn why covariance and contravariance are important, what they are, and how to use them in various scenarios using a few examples. [sc name="github"...
In this article, we're going to learn how to serialize a C# object into a JSON string using the two main JSON libraries in the .NET ecosystem. Also, we're going to learn how to control different aspects of the serialization process. [sc name="patreon-source-code"...
In this article, we will discuss Constructors in C# and different types of constructors. More importantly, we will discuss these constructors' differences and use cases. [sc name="github"...
In this article, we are going to learn about the unsafe code in C#. In general, the code that we write in C# is safe code. It creates managed objects and doesn't access the memory directly. On the other hand, unsafe code in C# is code that is not in direct control of...
In this article, we are going to see how to determine if a method is called during test execution. To do that, we are going to use Moq and its verification APIs. [sc name="github"...
HttpClient and RestSharp are HTTP Client libraries that we can use to consume APIs. Working within the domain of Web Development, we will find ourselves in a situation where we need to consume external APIs. Both HttpClient and RestSharp are tools for implementing...
Unit Testing is extremely important for creating robust software. It's very simple in principle but it can get a little bit tricky when it comes to real-world applications that depend on databases. In this article, we're going to explore some approaches to testing...
Have you ever needed to sort a list of items, but didn't want to use the built-in sorting function? If so, you may be interested in learning about Shell Sort, which is similar to insertion sort but uses a different approach to sorting. In this article, we'll take a...
In ASP.NET Core dependency injection, we usually register injectable dependencies at the start of our program. We can then resolve these dependencies (services) much later once when we need them. Sometimes, however, we may need to resolve those dependencies even...