Static Vs Readonly Keyword in C#

static vs keyword

In C#, both the static and readonly keywords are used to define fields, but they serve different purposes and are used in distinct scenarios. Understanding when and how to use these keywords is essential for writing efficient and maintainable code. Let’s dive into the differences and specific use cases for each. Please read this blog: … Read more

Sealed Class in C# – Easy Explanation

Sealed Class in C#

A sealed class in C# is a class that cannot be inherited by any other class. We can not use a sealed class as a base class. This can be particularly useful when you want to enforce certain behaviours and prevent further modifications through inheritance. Please read this blog: static vs readonly keyword in C# … Read more

Action and Func Delegates in C#

In C# programming language, there are various delegates to use. C# provides 2 built-in delegates: Action and Func. This article will cover Action and Func delegates in C#. Before we proceed further, we will first look into delegate. What is a Delegate? A delegate is an object that holds a reference to a method to … Read more

Cached Repository Pattern in C#

Cached Repository Pattern

In this article, we will learn about Caching a Repository Pattern in C# and .NET 8 and we call this Cached Repository Pattern. If you are new to design patterns then please read this – Design Pattern in C# Download the source code for this article : SharePointCafe GitHub Repository What is a Cached Repository … Read more

C# Amazing New Features

C# Amazing New Features

In this article, we are going to learn about C# amazing new features available in recent releases. For this article, we are picking a couple of the most exciting features of C# versions 10, 11 and 12. So, let’s start. File-scoped Namespace Declaration This feature is one of the most interesting features of C# 10. … Read more

.NET 6, .NET 7 and .NET 8 Performance Comparison

.NET 6, .NET 7 and .NET 8 Performance Comparison

As per Microsoft .NET 8 is more optimized than .NET 7 and .NET 6. Also, .NET 8 is the fastest version compared to .NET 6 and 7. In this article, we will compare .NET 6, 7 and 8 performance with the BenchmarkDotNet library. Read more about the use of BenchmarkDotNet library. Benchmark Compare of .NET … Read more

C# Foreach and Parallel Foreach Loop

Foreach loop in C#

C# programming offers numerous iteration statements to iterate through an array. Some of the iteration statements are for loop, foreach loop. In this article, we will learn the use of the foreach loop in C#. Understand the Iteration concept Iteration is the execution process for a defined number of times until the given condition is … Read more

Everything about Delegate in C# with Example

Delegate in C#

A Delegate is a very important topic in C# programming. In almost all C# interviews, we face these questions.So let’s understand this topic well so that we can tell anyone about the delegate at any time. What is a Delegate in C#? In simple words, Delegate holds the reference of a method. Please don’t get … Read more

Benchmarking with BenchmarkDotNet

Benchmarking with BenchmarkDotNet

In this article, we will explore BenchmarkDotNet which is a powerful tool for benchmarking C# code snippets so that we can track the performance of a method we write. So, let’s see this in action. You may like this article: .NET 6, .NET 7 and .NET 8 Performance Comparison What is Benchmarking? Benchmarking is the … Read more

Alias any type in C# 12

Alias any type in C# 12

C# 12 has numerous amazing features. One of the interesting features is Primary Constructors and another interesting feature is the use of aliases of any type and not just named types. What it does mean? It means that now we can create aliases for tuple types, array types, and pointer types. So, in this article, … Read more

RSS
YouTube
YouTube
Instagram