Tag Archives: reflection

Using Reflection in .NET

Reflection uses the object of type Type that describes assemblies, modules, types…

Through reflection it is possible to do many different things, for example:

  • Dynamically create object instances
  • Dynamically invoke methods
  • Check if an object implements an interface
  • Manipulate attributes set on objects
  • Mock values for testing
  • Retrieve debug information

These are just a few things you can do with it. In this post I’m going to show a simple example on how to use it to get descriptions on enums.
Continue reading

Advertisements