About
In this code snippet, we will take a look at reflection in C#.
Reflection is used to get metadata(information) about an object at runtime. We can get members(properties, methods) of objects and their data types. Reflection is also used for late binding. The ability to see the metadata of an object is for example, useful is when you use generics, as you don’t necessarily know the data type of a generic member until the object is created.
Let’s look at the code example below to see how reflection is used.
Code:
[amp-gist id=”99fb77a450b204d6f79b158550cdaf92″]