C# Hashtable vs Dictionary: When should you use a Hashtable or a Dictionary?

“In C#, a hashtable is a non-generic collection that can store key/value pairs of any data type. On the other hand, A dictionary is a generic collection that can store key/value pairs of specific data types.”

In this article, we will learn the differences between the Hashtable and Dictionary with examples.

C# Hashtable vs Dictionary
C# Hashtable vs Dictionary

Read more >>

C# Arrays: Everything You Need to Know About Array in C#

C# Arrays: An Array is used to store multiple values in a single variable, rather than declaring a separate variable for each element. It is a fixed-sized sequential collection of elements of the same type.
The data types of the elements in an array can be int, char, float, string, and so on, and they are stored in a contiguous location.

C# Arrays
C# Arrays

Read more >>

Types of Comments in C#: Single Line, Multiline and XML Comments

Comments-in-C-Sharp
Comments in C#

Introduction: Comments in C#

Comments are used in a program to make a section of code easier to understand. They’re used to make the code more readable and provide a formal description of it and how it works. 

The compiler ignores comments, so you may put them wherever in a program and not worry about them breaking it.

Read more >>

Generics in C#: A Comprehensive Guide with Code Examples and Explanations

Generics in C# allow you to write type-safe, reusable, and efficient code. In this comprehensive guide, you will learn everything you need to know about generics including how to create generic classes, methods, collections, and generic constraints. This article contains valuable information about C# generics that will help both beginners and experienced C# developers enhance their coding abilities.

C# Generics allow you to reuse the same code (class or method) with different data types. It refers to a generalized version of something rather than a specialized version.

Generics in C#
Generics in C#

Read more >>

Top 5 Difference between Call by Value and Call by Reference

In this post, we’ll look at a simple but difficult interview question in C#: Call By Value vs Call By Reference.

This is a question that both fresher and experienced developers are asked in interviews. It’s one of the most frequently asked questions by technical interviewers.

Call by Value and Call by Reference
Difference between Call by Value and Call by Reference

Read more >>

ASP.NET Core Middleware With Examples

In ASP.NET Core, middleware is a component that can be plugged into the request processing pipeline to perform some action for each request. It sits between the server and the application and is responsible for handling requests and responses.

asp-net-core-middleware
asp-net-core-middleware

Read more >>

C# Collections – Understanding collections in C# with [Examples]

Collections in C#
C# Collections types

Collections in C#

A collection in C# is a class that represents a group of objects. Collections can be used to perform various operations on objects, such as storing, updating, deleting, retrieving, searching, and sorting.

Collections are defined in the System.Collections namespace. They are a predefined set of classes for storing multiple items in a single unit.

Read more >>

WCF vs Web API: Top 10 Differences Between WCF and Web API

WCF (Windows Communication Foundation) is a framework for building service-oriented applications. It allows communication between applications on different devices, across computers and networks. WCF is part of the .NET framework, and it provides a runtime environment for applications that use distributed communication.

Web API is a framework for building HTTP services. It is a part of the ASP.NET platform and it allows you to create RESTful (representational state transfer) services, which can be consumed by a wide range of clients including web browsers and mobile devices.

This article will provide a practical comparison of WCF and Web API to help you decide which is the better option for your needs. We will discuss the differences between these two frameworks in detail.

WCF VS WEB API
WCF VS WEB API

Read more >>

C# 10 New Features: A Comprehensive Guide with Code Examples

As a programming language, C# has gone through several iterations, and with each new version, we see new features and enhancements that make programming with it even better.
C# 10, the latest language version, is no exception.

In this article, we will explore the new features of C# 10 and provide examples of how to use them in your code.

C# 10 New Features
C# 10 New Features

Read more >>

C# Struct vs Class |Top 15+ Differences Between Struct and Class

Difference Between Struct and Class in C#:

One key difference between structs and classes is that Structs are value types, whereas classes are reference types.

In the case of structs, they are copied by value, meaning that a complete replica of the data is created when passed or assigned. On the other hand, classes are copied by reference, meaning that only a reference to the original data is passed around rather than a full duplication.

C# struct vs class
C# struct vs class

Read more >>

C# List with examples

In this article, we will learn about the C# list with the help of multiple examples.

List<T> is a dynamic collection that contains multiple objects of the same data type that can be accessed using an index.

It is similar to an array but can grow or shrink in size. Lists are commonly used to store and organize data in a sequential manner. It can dynamically perform operations like adding, searching, shorting, and removing elements from a collection.

The following diagram illustrates the methods and properties of the List<T> class.

C# List
List in C#

Read more >>

C# Access Modifiers: Everything You Need to Know (With Examples)

One of the fundamental features of C# is the use of access modifiers. These modifiers control the accessibility of classes, methods, and variables in your code.

In this article, we will take a comprehensive look at C# access modifiers, exploring their various types, their effects on code, and best practices for using them.

Access Modifiers in C#
C# Access Modifiers

Read more >>

C# Dictionary – How to Use a Dictionary in C# [With Examples]

A Dictionary in C# is a collection that stores a set of keys and values, similar to a Hashtable. Dictionaries are useful for storing data that needs to be quickly retrieved using a key.

  • In C#, a Dictionary<TKey, TValue> is a generic collection that stores key/value pairs data organized by the unique key.
  • In C#, the Dictionary class is part of the System.Collections.Generic namespace. It is a dynamic collection that can be resized on-the-fly, allowing you to add or remove items as needed. It means that you don’t have to pre-define the size of the dictionary, and it can grow or shrink depending on the data being stored.
C# Dictionary
C# Dictionary

Read more >>

Views in SQL Server with [Examples]

In SQL, Views are virtual tables that give a simplified and customized view of data from one or multiple database tables. They are similar to a table with rows and columns but do not store actual data.

This article will cover the different types of views in SQL Server with multiple examples. Also, we will learn about how to create, modify, update, and delete views in SQL Server.

View in SQL Server
Views in SQL Server

Read more >>

Triggers in SQL: Understanding Triggers and Trigger Examples in SQL Server

Triggers in SQL are special types of stored procedures that are automatically executed in response to specific events or changes within a database. In this article, we will explore triggers in SQL and provide a trigger example in SQL Server to help you understand how they work.

SQL Server Trigger Update, Insert, Delete
Triggers in SQL

Read more >>