In the previous post of this short series we saw how to create a method using Reflection.
We can also create fields in our custom type. Here’s how to create a standard private field:
You can use the FieldAttributes enumeration to modify the properties of the field. E.g. here’s how to declare the field public and readonly – which is not a very clever combination, but there you have it:
View all posts on Reflection here.