Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Everything / generics

Generics

generics

Great Reads

by Jörgen Andersson
A high performance extension for creating a DataTable from a Generic collection.
by Yuriy Magurdumov
Simple generic data structure to maintain hierarchical objects
by Qwertie
Want to square-root an arbitrary type T in your generic code and multiply it by its natural logarithm? No problem.
by AlexCode
Take your Generic Handlers to the next level...

Latest Articles

by Jörgen Andersson
A high performance extension for creating a DataTable from a Generic collection.
by Yuriy Magurdumov
Simple generic data structure to maintain hierarchical objects
by Qwertie
Want to square-root an arbitrary type T in your generic code and multiply it by its natural logarithm? No problem.
by AlexCode
Take your Generic Handlers to the next level...

All Articles

Sort by Score

generics 

by Yuriy Magurdumov
Simple generic data structure to maintain hierarchical objects
by DiponRoy
Let's make a lambda expression from a property name of a particular entity, and use it for OrderBy shorting
by Andrew Rissing
How to get that last little nagging line to be covered...
by omid rezaei hanjani
Customized implementation of the Observer pattern using Generics.
by omid rezaei hanjani
Customized implementation of the Singleton pattern using Generics.
by Paulo Zemek
All classes are naturally Lazy loaded.So a better implementation will be:public class Singletonwhere T: new(){ public static readonly T Instance = new T();}You will notice that before calling the singleton class, the object will not be loaded.Surely there are...
by manish31383
How to do controlled ThreadPooling using .NET Framework 4.0.
by nit_singh
This is an example to Convert from a datatable to a specific type of collection using Generic
by Vano Maisuradze
Very nice!I've modified ToCollection(this DataTable dt) extension function, so if DataTable column names and class property names are different, then you can use this alternative:public static List ToCollection(this DataTable table, Dictionary dic){ List lst = new...
by Damian Flynn
Here's a couple of gems...From IList to DataTable.From DataTable to array of T.// DataTable: from IListpublic static DataTable ToDataTable(this IList iList){ DataTable dataTable = new DataTable(); PropertyDescriptorCollection propertyDescriptorCollection = ...
by Kishor Deshpande
Methods which facilitate the conversion from string to value type
by Abdul Ahad Monty
Convert DataTable to List using Generics.
by MahendraChawhan
Extension method for Generic Collection to DataTable
by DotNetSteve
Creating an extension class for View Models to save public properties using Generics and Delegates, replacing a reflection implementation
by Jakob Lithner
Dapper offers fast database handling with custom SQL strings. This wrapper simplifies life by taking generic POCO objects and creates necessary SQL strings on the fly, and it is still very fast!
by Nikita Mazhara
Describes how to implement generic methods for Microsoft Fakes Stubs and Shims using reflection constructed delegates at runtime
by jc3po
How generics can be used to sort lists easily and efficiently.
by Nowaki
Matrix, Quaternion and three Vector structures with IL generated at runtime to provide support for all number types.
by BrettPerry
A helper class to run functions in an asynchronous pattern using the Func delegate
by Ilka Guigova
Sample use of generics and type retrieval
by Mayur Shah
Markup Extension that allows you to declare Generic classes in Xaml
by Richard Deeming
This is an alternative for "Markup Extension for Generic classes"
by BrettPerry
A helper class to run func in ThreadPool.QueueUserWorkItem and receive the response from a delegate
by Hrishi Gupte
Processing Collection in C# .NET using multiple threads
by Alberto Nuti
In a console application, there is often the need to ask (and validate) some data from users. For this reason, I have created a function that makes use of generics and delegates to speed up programming.
by DiponRoy
Let’s see how to make a simple model or Entity mapper using reflections in C#
by ThiagoTane
This is an alternative for "Simple Model/Entity Mapper in C#"
by Henry Minute
Sorting Lists Using an Anonymous Delegate
by Bryan Lyman
Generic list wrapper that returns a smaller strongly typed sub-list which modifies the parent-list when changed, without using events
by Ammar Shaukat
C# 7.0 has been introduced with many new useful features. One of them is new datatype "ValueTuple". In this article, I'll be writing about Tuples in C# 7 briefly.