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

Reflection

reflection

Great Reads

by JohnX2015
This is a cross-platform general C++ engine, including a general runtime and a reflection engine.
by Vitaly Zhukov
This article describes how to create and use configurable plug-ins in your application.
by abhinav_soni
This article provides alternative to Java's Proxy class with bytecode manipulation.
by Dean Oliver
An alternative to Activator.CreateInstance

Latest Articles

by JohnX2015
This is a cross-platform general C++ engine, including a general runtime and a reflection engine.
by Vitaly Zhukov
This article describes how to create and use configurable plug-ins in your application.
by abhinav_soni
This article provides alternative to Java's Proxy class with bytecode manipulation.
by Dean Oliver
An alternative to Activator.CreateInstance

All Articles

Sort by Score

reflection 

by JohnX2015
This is a cross-platform general C++ engine, including a general runtime and a reflection engine.
by abhinav_soni
This article provides alternative to Java's Proxy class with bytecode manipulation.
by Dean Oliver
An alternative to Activator.CreateInstance
by Andrew Rissing
Using expressions, you can achieve a faster result with less code.public static T New(){ Type t = typeof(T); Func method = Expression.Lambda>(Expression.Block(t, new Expression[] { Expression.New(t) })).Compile(); return method();}Furthermore, this can...
by Dean Oliver
The final solution after much debate and optimization:public class DynamicInitializer { static readonly Dictionary> list = new Dictionary>(); public static T New() where T : class { return New(typeof...
by Jonathan Jandrell
I've tried a few different ways to dynamically create an object of 'unknown' type.This is my final, simple result: public static T Create() { Type type = typeof(T); return (T)type.Assembly.CreateInstance(type.FullName); ...
by Yves Vaillancourt
And why don't you just do this?public static T Create() where T : class, new(){ return new T();}
by Itai Basel
This article shows how to automatically initialize/reset automatic properties' default values.
by Richard Deeming
For .NET 4.0:using System;using System.Collections.Generic;using System.ComponentModel;using System.Reflection;using System.Linq.Expressions;static class AutomaticPropertyExtensions{ private static class Cache where T : class { public static readonly...
by saddam abu ghaida
This article describes how to convert any Data Table to List of Objects at runtime using Reflection
by Bjørn
How to automatically initialize a class for an inherited class instance
by PFalkowski
The way of calculating amount of memory occupied by some object in C#.NET
by benji_dv
How to clear all events is quite simple. It needs a finger of reflection...
by Pavel Kabir
This tip is about how to get collect the values for all instance fields of a given type.
by #realJSOP
This is an alternative for "Compareing Two Complex objects of same class"
by Lumír Kojecký
This tip shows how to compile and use C# code during runtime and its impact on speed.
by rvjagadheesh
A complete assembly reference tool for .NET which will display details on all methods, properties, enum for all classes in all namespaces
by Sumit Chawla
Custom String FormatWith using Reflection
by Matt T Heffron
This is an alternative for "Custom String FormatWith using Reflection"
by Kishor Deshpande
Methods which facilitate the conversion from string to value type
by Jaume González
To inherit an Entity Framework class, to extend it, bind to data and unmap it from DBContext.
by Jaume González
Solution using reflection to dynamically load and execute C# code in a workflow context
by MdAsifBd
Separate entity class mapping using Fluent API
by DotNetSteve
Creating an extension class for View Models to save public properties using Generics and Delegates, replacing a reflection implementation
by Metaphysico
Find Unit Tests that do not show up in test results.
by PIEBALDconsult
This is an alternative for "C# Convert DataTable to List of Objects Dynamically"
by murtaza dhari
A generic dropdown control using LINQ to SQL and Entities using Reflection
by Henning Dieterichs
This tip shows how to get quickly all Information of an Assembly
by jolsen
How to get a reference to a class member when all you have is its name and type.
by JIANGWilliam
This article introduces a handy way to get the calling Testing Assembly from a called Assembly
by Massimiliano Peluso "WeDev Limited"
Get Nested Property value using reflection and Linq.Expression
by cechode
Saw this a while back; it's simpler (dirty and wrong but... ):public static T Get(Func getDelegate, bool DefaultTOnNull = false, T defaultVal = null) where T : class{ T result = null; try { result = getDelegate(); } catch...
by farhad2161
In this article we will implement a general Parcelable class and name it ParcelableEntity. Then all other entity class can extend it, then they will be parcelable too. So there is no need to implement Parcelable class for other classes.
by Sunil P V
How to access a 64bit registry key from 32bit built application in .NET 3.5 and lower
by honey the codewitch
This tip shows you a robust way to get the type of items a collection can hold. It works with non-generic collections too.
by Farhad Taghavi Azar Sharabiani
This code makes a mechanism to implement some tasks for executing on Application-Start from anywhere.
by oppassum
Basic article to describe how to use Reflection for dynamically loading commands/etc
by Shweta Lodha
INotifyPropertyChanged revisited with .NET Framework 4.5
by Ilka Guigova
Sample use of generics and type retrieval
by Yuriy Magurdumov
PropertyMapper allows mapping object properties to string keys and accessing property values based on those string keys
by Handy Torres
Model Binder for ASP.NET Web Forms
by Simon Bridge
Illustrates how to quickly and dynamically populate an object from a data-row
by Kelqualyn
Same thing 10-100 times faster.Additionally, IndexMap can be built only once per DataTable.using System;using System.Collections.Generic;using System.Data;using System.Linq;using System.Linq.Expressions;using System.Reflection;namespace ReflectiveReader{ public static...
by rohitsies
CSV file generator using simplistic approach
by Moe Farag
While writing tests for methods that use .NET Reflection, I found out that Rhino doesn't expose stubbed method for reflected invocation.
by honey the codewitch
Solve some common resource complications in .NET with this simple utility class
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 Bhis
Various ways to sort list and compare results
by Huisheng Chen
Using reflection to dynamically verify if an assembly is in debug or release compilation
by discompsys
An easy way to allow local objects with direct access to invoke methods on a class, but prevent them from being part of the public API, for remote invocation.
by mohanaitec
WinForm DataGridView loading from ObjectCollection.