-
Book Overview & Buying
-
Table Of Contents
Metaprogramming in C#
By :
In this chapter, we have learned about the power of looking inward into our running process and collecting all the referenced assemblies and all the types of these assemblies. We’ve looked at how we can leverage even more metadata to gain access to the types of reference the assemblies are, be they package references or project references.
From this, we are empowered to start reasoning about types in a more meaningful way and really take advantage of the type system. Interfaces can serve as a very powerful method to mark types. The interfaces can, of course, enforce implementations of members that need to be there, but they can also just act as empty marker interfaces, serving as a way to bring explicit metadata into the assemblies.
In the next chapter, we will dive into how we can make full use of custom attributes to provide explicit metadata for your applications.