C# Corner
Tech
News
Videos
Forums
Trainings
Books
Live
More
Interviews
Events
Jobs
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Tags
No tag found
Content Filter
Articles
Videos
Blogs
Resources
News
Forums
Interviews
Complexity Level
Beginner
Intermediate
Advanced
Refine by Author
[Clear]
John Godel(6)
Jaimin Shethiya(5)
Jitendra Mesavaniya(2)
Munib Butt(2)
Ehsan Sajjad(2)
Ajay Kumar(2)
Ashish Shukla(2)
Amr Monjid(2)
Kamlesh Panchal(2)
Niharika Gupta(2)
Mahesh Chand(2)
Dinesh Gabhane(2)
Sardar Mudassar Ali Khan (2)
Aarav Patel(1)
Kiran Kumar(1)
Ng Cheehou(1)
Kautilya Utkarsh(1)
Punar Dutt Rajput(1)
Abhishek Duppati(1)
Vidya Vrat Agarwal(1)
Akhil Garg(1)
Sandeep Singh Shekhawat(1)
Vo Duc Thanh(1)
Vishal Gilbile(1)
Shantanu (1)
Abhishek Dubey(1)
Igor (1)
Micheal Xavier A (1)
Habibul Rehman(1)
Gurpreet Arora(1)
Pravesh Dubey(1)
Siddhesh Chalke(1)
Juan Francisco Morales Larios(1)
Bhuvanesh Mohankumar(1)
Ramakrishna Basagalla(1)
Sridhar Sharma(1)
Abhishek Jaiswal (1)
Manisha Sonawane(1)
Pawan Pandey(1)
Shalini Dixit(1)
Srinubabu Ravilla(1)
Dinkar Chavhan(1)
Sriram Surapureddy(1)
Munir Shaikh(1)
Matthew Cochran(1)
Saurabh (1)
Ashish Singhal(1)
Ahmed Abdel Ghany(1)
Sridhar Aagamuri(1)
Brajesh Kumar(1)
Priya Prajapati(1)
Raghunath Bhukan(1)
Akshay Amin(1)
Muiz Atolagbe(1)
Mariem Moalla(1)
Shubham Sidnale(1)
Jochen Bartlau(1)
Deepak Tewatia(1)
Jin Necesario(1)
Vijay Yadav(1)
Siddhesh Chavan(1)
Tahir Ansari(1)
Sarthak Varshney(1)
Jagannath Sethi(1)
Arindam Dawn(1)
Esamaldin Mohammed(1)
Jaydeep Patil(1)
Manikandan M(1)
Shivam Payasi(1)
Aman Panjwani(1)
Anmol Arora(1)
Matea Andrei(1)
Periyasamy Vellingirisamy(1)
Varun Setia(1)
Khushbu Saini(1)
Usman Sheikh(1)
Pascal Declercq(1)
Adrita Sharma(1)
Ashutosh Gupta(1)
Nirmal Dayal(1)
Resources
No resource found
How to Use Generics in C# to Write Reusable and Type-Safe Code
Apr 03, 2026.
Master C# generics! Learn how to write reusable, type-safe code, avoid duplication, and boost performance. Explore generic classes, methods, collections, and constraints.
Collections in C#: From Arrays to Advanced Generics for Professional Developers
Jul 30, 2025.
This article provides a clear and practical overview of the most common C# collections, including arrays, lists, dictionaries, queues, stacks, and sets. It explains their key features and use cases with easy-to-understand examples of employee management.
Exploring Advanced Generics in C#: A Practical Guide with Examples
Nov 25, 2024.
This article aims to provide a guided tour of some advanced topics in C# generics, such as constraints, covariance and contravariance, and custom generic interfaces.
How C# Generics is different from Java Generics
Sep 24, 2024.
In this article, we explore the distinctive features of C# generics and how they enhance programming efficiency. We compare generics with non-generic types, focusing on benefits like type safety, code reusability, and performance optimization.
What is Generics in .NET C# with example
Apr 15, 2024.
Generics in C# represent a cornerstone of modern software development, offering a powerful mechanism for creating reusable and type-safe code. This comprehensive article explores the fundamentals of generics, delving into practical examples and best practices to harness their full potential.
Traits and Generics in Rust
Dec 20, 2023.
In this article, we will explore Traits and Generics in Rust. Explore the power of Rust, a programming language known for speed, memory safety, and clever code writing. Uncover the concepts of 'traits' and 'generics,' enabling reusable, flexible, and type-safe coding. Traits act as guides, while generics facilitate code adaptability. Discover how to declare, implement traits, and use generics for functions and data structures.
Using The New Generics Pattern Matching Feature In .NET 7
Nov 30, 2022.
In this article, you will learn how to use the new generics pattern matching feature in .NET 7.
Understanding Generics In C#
Apr 23, 2020.
In this article, you will learn about generics In C#.
Equality Operator (==) With Inheritance And Generics In C#
Apr 30, 2017.
Equality Operator (==) With Inheritance And Generics In C#.
Using Generics In C#
Sep 13, 2016.
Learn everything about generics in C#.
Implementing Repository Pattern And Dependency Injection In ADO.NET Using Generics In C#
Dec 13, 2015.
Learn how to implement design patterns in an object-oriented paradigm to create generic solutions. This guide covers a practical example where a web application interacts with a database using the repository pattern and dependency injection. It includes code snippets for a repository class, user repository, and service layer integration.
Importance of Generics in C#
Sep 03, 2014.
This article explains the importance of Generics in C# and how to implement them.
An Example of Generics Using C# in ASP.Net
May 17, 2014.
This article explains how generics are useful over non-generics and explains how to reuse code using generics.
The Basic Concepts of Generics in C#
Apr 24, 2013.
In this article I explain the basic concepts of Generics in C#.
Implementing Generics Classes and Functions In C# Programs
Feb 13, 2013.
Today we'll have a look at how we can implements generics in our program and how we can make our functions, code more robust and less prone to changes in program code.
MyFluent - A Validation Framework using .Net Generics and Lambda Expressions (Fluent paradigm)
Sep 10, 2012.
In this article you will learn A Validation Framework using .Net Generics and Lambda Expressions (Fluent paradigm).
Introduction of Generics in Java
Apr 18, 2012.
In this article we are going to describe a new concept of Java which was introduced in J2SE 5.0. In this the system allows a type or method to operate on objects of various types while providing compile time safety.
Power Of Yield, Generics And Array In C#
Jul 14, 2008.
This article tells you an additiional way to get reverse processing of array with help of generics and yield.
Generics in C#: Introduction and Usage
Dec 02, 2025.
Unlock the power of Generics in C#! This guide introduces Generics, explaining how they enhance type safety and performance by deferring data type specification. Learn with examples!
Understanding the Art of C# Generics
Mar 01, 2024.
Unlock the power of C# Generics with our comprehensive guide. Master best practices, explore advanced scenarios, and elevate your coding skills with this in-depth C# Generics tutorial. Learn to write efficient, flexible, and type-safe code for a wide range of scenarios, ensuring optimal performance.
Generics in C#: Enhancing Code Reusability and Type Safety
Oct 04, 2023.
In this article, we will explore the concept of generics in C# with detailed examples, showcasing how they enhance code flexibility and maintainability.
Generics in C#
Aug 25, 2023.
Harness the Versatility of C# Generics: Boost Code Reusability and Type Safety. Dive into how Generics empower adaptable, efficient code, accommodating various data types while maintaining robust type checking.
Generics in Swift
Oct 15, 2019.
In this article, I will give a brief introduction of Generics in Swift.
C# Generics
Jun 26, 2019.
In this article, you will learn about C# generics.
Default(T) In Generics
Sep 27, 2017.
Default represents default value of T parameter in generics intructions. In several cases, the default keyword is an absolute unknown and we think it’s unnecessary or its functionality is null. There are many development moments with the generics classes where the default keyword can be useful.
Generics In C#
May 07, 2016.
In this article you will learn about Generics in C#.Generics in C# provide a powerful way to create classes, interfaces, methods, and delegates with a placeholder for data types. They enable developers to write code that is independent of data types, providing greater flexibility, type safety, and code reusability. Generics allow you to design classes or methods that operate on any data type while still maintaining type safety during compile-time.
Generics And Generic Collections In C#
Dec 16, 2015.
In this article you will learn about Generics and Generic Collections in C# language.
A Simple Way to Learn Generics
Nov 20, 2015.
In this article we will look at the basics of generics. Generics is a mechanism offered by the Common Language Runtime (CLR) and programming languages that provide one form of code re-use and algorithm re-use.
Generics in C#
Jan 11, 2014.
This article is all about generics in C# and how to improve performance overhead.
Generics in .Net
Sep 27, 2013.
This article introduces Generics of .Net (actually the Common Language Infrastructure (CLI)).
All about Generics
Jul 20, 2013.
Using this article we will learn all about generics in C#.
Generics in Java
Jun 27, 2013.
This article provides a brief overview of Generics. After this article one will be capable of working with Java Generics.
Generics in C#
May 16, 2013.
Generics allow us to define type-safe classes without worrying about type safety and performance.
Constraints in Generics
Mar 28, 2013.
Constraints are used in Generics to restrict the types that can be substituted for type parameters. Here we will see some of the commonly used types of constraints.
Generics in .NET
Mar 27, 2013.
In the following article we will see how to use Generics in .NET.
Generics in .NET
Apr 23, 2011.
An introduction to Generics
Generics in .Net 2.0 made simple
Jun 22, 2008.
Generics provide the solution to a limitation in earlier versions of the common language runtime and the C# language in which generalization is accomplished by casting types to and from the universal base type Object. By creating a generic class, you can create a collection that is type-safe at compile-time.
Generics in C# - Part II
Apr 11, 2008.
In part II of generics in C# we will see how to create generic classes, structures, interfaces, and delegates. We will also see how to create a custom generic collections.
Generics in C# - Part I
Mar 28, 2008.
In Part I of this series you will see the importance of generics, you will learn how to use generic types which in the System.Collections.Generic namespace and you will also learn how to create generic methods.
Generics in C# 2.0
Aug 17, 2007.
In this article, I just try to discuss on type safe data structures with the help of Generics in C# 2.0.
An Elegant C# Data Access Layer using the Template Pattern and Generics
May 22, 2006.
The GOF Template pattern coupled with .NET 2.0 Framework generics provides an awesome synergistic alliance. This article demonstrates how to drastically reduce the amount of code required in building a data access layer. Less code to debug... less code to break... less code to maintain... what could be better?
Generics in C# 2.0
Apr 17, 2006.
In this article, I specifically talk about Generics and how they improve upon arraylists and how they solve the issues posed by ArrayLists.
An Introduction to C# Generics
Feb 06, 2006.
There is a reality; most of the developers confuse about C# Generics. Actually, there is no reason for that. If your background comes from C++ or Java you may understand more easily. What “Templates” tell you from your C++ knowledge or “Generics” from Java.
Generics in C# 2.0
Feb 02, 2006.
In this article we will see how we can use generics in C#, we have read this concept as templates in C++.
What the heck is Generics?
May 20, 2005.
This article provides the use of Generics and scenarios in which it will be useful.
What the heck is Generics?
May 20, 2005.
Generics are new addition to C# 2.0. This article provides the use of generics and scenarios in which it will be useful.
Generics in C#
Oct 06, 2004.
Generics are the most useful C# 2.0 language extensions, beside Anonymous methods, Iterators, Partial types And Nullable types.
Generics in C#
Mar 08, 2004.
Parametric Polymorphism is a well-established programming language feature. Generics offers this feature to C#. The best way to understand generics is to study some C# code that would benefit from generics.
Building Background Processing Services with .NET Worker Services
Jul 20, 2026.
Learn to build robust background processing services with .NET Worker Services. Improve app performance and user experience by offloading tasks.
Mastering .NET Interviews – Part 3: Advanced C# Features
Jun 20, 2026.
Master advanced C# features for .NET interviews: Generics, Delegates, Events, LINQ, and Async/Await. Elevate your coding skills!
Collections in .Net (C# Guide for Beginners)
May 01, 2026.
Master .NET collections in C#! This beginner's guide covers generic, non-generic, and concurrent collections. Learn to efficiently store and manage data for APIs, databases, caching, and real-time apps.
From LLMs to PT-SLMs: How GSCP-15 Turns Generic Models into Governed, Enterprise-Grade Delivery
Jan 19, 2026.
Discover PT-SLMs: tailored small language models for enterprise. Learn how GSCP-15 ensures governed, cost-effective, and reliable AI delivery at scale.
Generative AI: How GSCP-15 Turns Generic Models into Governed, Enterprise-Grade Delivery
Jan 19, 2026.
Unlock enterprise-grade AI with PT-SLMs & GSCP-15. Govern generic models for controlled, cost-effective, and auditable AI delivery at scale. Learn how!
AI Agents: How GSCP-15 Turns Generic Models into Governed, Enterprise-Grade Delivery
Jan 19, 2026.
Discover how GSCP-15 transforms generic AI models into governed, enterprise-grade delivery systems using PT-SLMs for enhanced control, cost-efficiency, and auditability.
Artificial Intelligence: How GSCP-15 Turns Generic Models into Governed, Enterprise-Grade Delivery
Jan 19, 2026.
Unlock enterprise-grade AI with GSCP-15! Transform generic LLMs into governed, cost-effective PT-SLMs for reliable, scalable, and auditable AI delivery.
How Do I Use AI to Personalize Sales Outreach at Scale Without Sounding Generic?
Dec 31, 2025.
Learn how to use AI, like ChatGPT, to personalize sales outreach at scale without sounding generic. Discover proven strategies for relevance and credibility.
Exploring nameof Support for Unbound Generic Types in C# 14 (.NET 10)
Dec 29, 2025.
Unlock compile-time safety with C# 14's nameof operator for unbound generic types! Simplify logging, DI, and validation. Boost code maintainability in .NET 10.
Chapter 14: Templates and Generic Programming in C++
Oct 23, 2025.
Explore C++ templates, the cornerstone of generic programming. Learn how to write functions and classes that work with any data type, avoiding redundant code. Discover function templates, class templates, and template instantiation with practical examples like swap_values and a Pair class. Understand how templates power the Standard Template Library (STL).
Unit Testing: Non-Generic Collections in MSTest
Oct 07, 2025.
Struggling to unit test non-generic collections like ArrayList in MSTest? This article highlights a common pitfall: attempting to use Assert.Contains with incompatible types. Learn why the example code fails to compile and discover effective strategies for verifying the contents of non-generic collections using MSTest's assertion methods. We'll explore type checking and alternative approaches for robust unit testing.
Difference Between Generic Host and Web Host in .NET Core
Sep 12, 2025.
Understand the crucial differences between Generic Host and Web Host in .NET Core. This article clarifies their roles, evolution, and when to use each. Learn why Microsoft shifted to Generic Host for unified hosting, supporting web apps, worker services, and console applications. Discover the benefits of flexibility, scalability, and a consistent development experience. Choose the right host for your .NET Core project and future-proof your applications.
When to Use Generic vs Non-Generic Collections in C#
Aug 19, 2025.
Discover the differences between generic and non-generic collections in C#. Learn their impact on performance, type safety, and usability with examples, helping you choose the right collection for efficient development.
Types of Classes in C# with Examples | Concrete, Static, Abstract, Sealed, and More
Jun 12, 2025.
Learn all the types of classes in C# with clear examples and use cases. Understand when to use abstract, static, sealed, generic, and partial classes in .NET Framework.
The Hidden Costs of Null Checks in Generic C# Code
Apr 27, 2025.
Learn how to properly perform null checks in generic C# code. Avoid hidden performance issues like boxing by using EqualityComparer<T>.Default and modern is null techniques for efficient, clean code.
How to Convert a DataTable to a List of Objects in C#
Apr 27, 2025.
Learn how to convert a DataTable to a List<T> in C#. Explore manual, reflection-based, and LINQ methods for better performance, type safety, and cleaner code. Improve maintainability in modern C# applications.
ScopedValueChanger<T> - A very helpful Generic Helper Class to Temporary Change Values
Apr 25, 2025.
This article explores the ScopedValueChanger<T> class, a utility designed to manage temporary value modifications with automatic restoration. Implementing the IDisposable interface ensures that changes made within a scoped context are reversed, maintaining application state integrity.
Essential C# Keywords
Dec 25, 2024.
This article explains important C# keywords that help in writing more efficient code. It covers keywords like volatile, value, get, set, yield, partial, and where, describing their uses in a simple manner. These concepts are essential for anyone looking to improve their C# programming skills.
TypeScript Essential Features
Oct 07, 2024.
TypeScript offers essential features that enhance JavaScript development, including static typing, type inference, and support for interfaces and generics. It provides tools like classes, enums, and modules, enabling better code structure.
Guide to Dependency Injection in .NET Core
Aug 13, 2024.
Dependency Injection (DI) in .NET Core enhances application design by promoting loose coupling, improved testability, and maintainability. It involves injecting services via constructor injection, with services registered as transient, scoped, or singleton. DI simplifies managing complex dependencies and testing.
Generic Repository with EF Core Store Procedure in .NET Core 8
Jul 16, 2024.
Entity Framework Core (EF Core) empowers .NET developers with seamless database interaction through object-relational mapping (ORM) and support for stored procedures. It optimizes performance by executing complex SQL logic directly on the server, enhancing efficiency for CRUD operations.
Generic Repository with EF Core in .NET Core 8
Jul 03, 2024.
Observe the Entity Framework Core Generic Repository! The subject that will make some people uncomfortable. They are unwilling to discuss it at all. Others, on the other hand, adore it and become giddy at the mere mention of the generic repository pattern.
Func Delegates in .NET Core C#: Syntax, Usage and Examples
Jun 13, 2024.
Func and Action are two generic delegate types that are built into C#, so you usually don't need to explicitly define custom delegates. A generic delegate called Func is part of the System namespace. It has one out parameter and zero or more input parameters. As an out parameter, the final one is regarded as such.
Fix Generic Error in Custom Activity Using Batch Account in ADF
Jun 11, 2024.
While executing a C# code in custom activity using batch activity in ADF sometimes it would get the error "The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection.
UnderStanding nameof Operator in C#
May 28, 2024.
The nameof Operator retrieves names of variables or members dynamically, aiding in code maintenance. Raising PropertyChanged Event notifies property changes in INotifyPropertyChanged implementations. Argument Checking and Guard Clauses ensure robust code by validating inputs.
Understanding Generic Constraints in C#
May 21, 2024.
Generics in C# allow you to define classes, methods, and interfaces with a placeholder for the type of data they store or use. This flexibility enables you to write more general and reusable code.
Exploring in Depth Of Abstraction in C#
May 14, 2024.
Dive deep into abstraction in C#, exploring OOP concepts like encapsulation, inheritance, and polymorphism. Learn about abstract classes, interfaces, generics, and advanced features like delegates and events, enhancing code modularity and scalability.
Dictionary in .NET C#: Syntax, Methods, and Example
May 07, 2024.
In C#, a dictionary is a generic collection that holds elements as pairs of keys and values. The Non-Generic Hashtable collection and the Generic Dictionary operate extremely similarly.
HashSet .NET C#: Usage, Methods, and Example
May 03, 2024.
A hash set is an unordered list of distinct elements in C#. In.NET 3.5, this collection is released. When we wish to stop duplicate pieces from being added to the collection, we typically utilize it. When compared to a list, the HashSet performs substantially better.
Bubble Sort Algorithm in C# with Generic Method Example
Apr 15, 2024.
Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.
Why we should learn C#?
Feb 26, 2024.
This article explores the reasons behind choosing C# over other languages, delving into its evolution, key features like object orientation, lambda expressions, LINQ, generics, and its adaptability for modern development needs.
New Features of Rust 1.73
Nov 02, 2023.
Rust 1.73 is a major release that includes a number of new features and improvements, such as impl Trait syntax, generic associated types, and improved borrow checker performance. These changes make Rust more expressive, efficient, and user-friendly.
Generic in C#
Sep 01, 2023.
Generics in C# 2.0 revolutionize code design by decoupling classes and methods from data types. They're key in creating strongly typed, reusable, and performant code. You declare generics using the `<>` symbol.
Mastering C# Enums: An Essential Guide with Examples
Jun 13, 2023.
Unleashing the Power of a Generic Event Bus in Angular: Building a Powerful and Scalable Architecture
May 30, 2023.
A generic event bus in Angular acts as a central communication hub that enables components to publish and subscribe to events. It promotes loose coupling and enhances the flexibility and scalability of large-scale applications. By leveraging the event bus, developers can establish efficient communication between different parts of the application, facilitating seamless cross-component and cross-module interactions.
Create Generic HttpClient Call Function With Error Handling In C#
Mar 09, 2023.
This article presents a step-by-step guide on how to create a generic HttpClient call function in C# that can handle different request methods, request body types, response types, and error handling using optional parameters. By following the provided code examples and explanations, readers can learn how to simplify HTTP requests in their C# applications and reduce the risk of errors.
Generic Interface And Generic Repository For Developing ASP.NET Core Web API
Feb 28, 2023.
In this article, you will learn about Generic Interface and Generic Repository for Developing Asp.net Core Web API.
Unit Of Work With Generic Repository Implementation Using .NET Core 6 Web API
Dec 04, 2022.
Unit Of Work with Generic Repository implementation using .NET Core 6 Web API.
Using The New Generic Number Interface In .NET 7
Nov 28, 2022.
In this article, you will learn how to use the new generic number interface in .NET 7.
Implement The Generic Badge View In Xamarin.Forms
Aug 03, 2022.
In this article, I will explain the Generic Badge in xamarin forms. We can implement the badge for Android, iOS and UWP. The plugin creates a custom renderer for each platform and a custom attached property for adding tab bar badges, which can be bound in XF shared code.
Generic Delegates In C#
May 17, 2022.
Here ill describe that why we need Generic Delegates what are Generic Delegates, keyword used in Generic Delegates and their type with example
Collections In C#
Apr 05, 2022.
The purpose of this article is to demonstrate how to work with arrays and the issues associated with them, followed by Non-Generic collections and their issues, and finally Generic collections which solve both arrays and Non Generic types of problems.
Usage Of STL In CPP Programming
Mar 23, 2022.
Standard Template Library that is considered as the bundle of template classes and pre defined functions that is highly used segment for the generic programming.
Implement Unit Of Work And Generic Repository pattern in a Web API .NET Core Project Using EF
Feb 21, 2022.
Complete guide to implement Unit of Work with Generic Repository Pattern with Entity Framework in a WEB API .NET Core project
Generic Implementation For Serializer/Deserializer Using Google Protocol Buffer
Sep 24, 2021.
Serialize or deserialize the input using google protocol buffer library in generic implementation.
New Generic Collection In .NET 6 - A Priority Queue
Jun 17, 2021.
In this article, you will learn about the new Generic Collection in .NET 6 a Priority Queue.
Generic Classes And Functions
Jan 22, 2021.
In this article, you will learn about the concept of generic classes and functions.
Generic CRUD Operations For CosmosDB
Jun 02, 2020.
In this article you will learn about Generic CRUD Operations for CosmosDB.
Generic Way To Export Data To Any Textformat In C#
Apr 12, 2020.
An extremely powerful and flexible way to export data to any text format (including XML & JSON)
Generic Validation Service for Reactive Forms
Apr 10, 2020.
In this article, we will create a common service that will help validate and log error messages in one place, rather than writing it in every component
Implementing C# Generic Collections Using Collection<T>, ICollection<T> With IEnumerator<T>
Jan 24, 2020.
In this article, you will learn how to create your own custom collections using Generic Collections class.
Lazy Loading with Generic Methods
Nov 11, 2019.
In this article, we will learn Lazy Loading using Generic Method in C#