c#

Static Vs Readonly Keyword in C#
.
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:…

Sealed Class in C# – Easy Explanation
.
Sealed classes restrict users from inheriting them. We can use sealed keywords to make a class sealed. The keyword tells the C# compiler that the class is sealed and cannot be extended. A method can also be sealed., and hence this method can not be overridden. In this article, we will learn about the sealed…

.NET MVC with SQL Server Database
.
In this article, we will learn .NET MVC with SQL Server database and entity framework. Previous Chapter: Routing in MVC The .NET MVC (Model-View-Controller) framework is a popular framework for building web applications. It promotes a clean separation of concerns by dividing the application into three main components: When working with an SQL Server database…

Temp Data, View Bag, and View Data in .NET MVC
.
In the previous article, we created the first MVC application in Visual Studio 2022. In this article, we will learn the mechanism available in ASP.NET MVC for managing and passing data between your controller and views – Temp Data, View Bag, and View Data. Understand their purpose, scope, and best practices for effective implementation. Previous…

First .NET MVC Application using Visual Studio
.
MVC is a widely adopted software design pattern that separates an application’s data, user interface, and control logic into three interconnected components: the Model, the View, and the Controller. This architectural pattern promotes code organization, scalability, and maintainability. In our previous article, we saw the fundamentals of .NET MVC. Setting up a New MVC Project…

Cached Repository Pattern in C#
.
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…

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.…

.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…

C#ย Foreach and Parallel Foreach Loop
.
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…

Everything about Delegate in C# with Example
.
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…

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…

C# 12 : Primary Constructors
.
C# 12 introduces multiple amazing features. But, one of the features which I liked most is the Primary Constructor. What is a Constructor? We are all familiar with the constructor. It is a special method which we use to initialize the object of a class. The Constructor executes as soon as we create the object…

Work with Variables and Data Types in C#
.
In this article, we will explore Variables and Data Types in C#. Before we proceed further, let us first understand what Data is. This article is helpful for beginners or preparing for an Interview as a C# programmer. What is Data? In computer programming, data is one of the most essential parts of any application…
Lambda Expression in C# with Examples
.
A lambda expression is a short way to describe an anonymous function in C#. The abbreviated syntax of Lambda Expression helps to create Delegates and expressions. So, in this article, we will see Lambda Expression in C# with examples. We can use the lambda function to quickly define a method and then pass it as…
IEnumerable and IQueryable in C#
.
In this article, we will learn IEnumerable Vs IQueryable. Both IQueryable and IEnumerable are interfaces in .NET that represent a collection of objects. However, they have some important differences in how they work and when to use them. So, let’s begin. What is IEnumerable? IEnumerable lets you iterate through a collection of objects. It contains…

Tuple in C# with Example
.
In this article, we will learn about Tuple in C#. What is a Tuple? A tuple is a reference type lightweight data structure that may contain different data types. It is introduced in C# 7.0. Tuple is useful when we want to store data of different data types without creating a new one. Syntax to…

Dependency Injection in C#
.
In this blog, we are going to learn about Dependency Injection. And, how we can implement Dependency Injection in C#? We will also learn the ways we can implement Dependency Injection in C#. What is Dependency Injection (DI)? So, let’s first define the Dependency Injection. Dependency Injection is a design approach, which helps programmer to create…

Abstract Class Vs Interface in C#
.
Abstract Class Vs Interface is one of the most asked questions in an interview. In this article, we will learn what are the main differences between abstract class and interface. And also we will know in which cases abstract classes and interfaces can fit in our project. So, let’s start. Abstract Class in C# In…














