Genereting proxies during runtime using Reflection.Emit

Reflection.Emit is very powerful tool. It creates IL code and since C# is converted into IL too, we have the same functionality as in C# and even more. It is very powerful and at the same time very complicated. Because of that it is worth to discuss how and for what it should be used. One idea is to create dynamic code with automatic implementations of interfaces – proxy types.

Continue reading “Genereting proxies during runtime using Reflection.Emit”

Faster than Reflection: Delegates. Part 3.

This is third article in series, that explains how to create delegates for public and non-public members of public, non-public or not known in compile-time types. If you are not familiar with previous articles and looking for detailed explanation of how delegates works, how they are created and why, I strongly encourage you to read first two. If you are just looking for a way to create delegates for methods or constructors it is not necessary.

Code with new features and with bug fixes is available on GitHub and as Nuget package. Continue reading “Faster than Reflection: Delegates. Part 3.”

Faster than Reflection: Delegates. Part 2.

This is second article in series, that explains how to create delegates for public and non-public members of public, non-public or not known in compile-time types. If you are not familiar with previous article and looking for detailed explanation of how delegates works, how they are created and why, I strongly encourage you to read it first. If you are just looking for a way to create delegates for methods or constructors it is not necessary.

Last article in series you can find here.

Code with new features and with bug fixes is available on GitHub and as Nuget package.

In previous article and first one in series, we covered:

  1. Static
    1. Properties
    2. Fields
  2. Instance
    1. Properties
    2. Fields
    3. Indexers

Now it is time to cover following members.

  1. Static
    1. Methods
  2. Instance
    1. Methods
    2. Constructors

Continue reading “Faster than Reflection: Delegates. Part 2.”