Creating and Using Types with Reflection, Custom Attributes, the CodeDOM, and Lambda Expressions
What You Will Learn in this Chapter
- Using the System.Reflection namespace
- Reading and creating custom attributes
- Generating code using the CodeDOM namespace
- Understanding lambda expressions
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
You can find the code downloads for this chapter at www.wrox.com/remtitle.cgi?isbn=1118612094 on the Download Code tab. The code is in the chapter08 download and individually named according to the names throughout the chapter.
This chapter has a mix of topics that will be covered on the exam, and these four topics do not directly relate to each other. The first three topics cover features that can be used to examine, customize, or generate C# code, while the last topic explains how to write shorthand syntax for your existing methods. It is especially important to understand the concept of lambda expressions because not only will you see them used extensively in Chapter 10, “Working with Language Integrated Query (LINQ),” but you will see questions on the test that use lambda expressions and you could be asked what the result of the expression would be.
Table 8-1 introduces you to the exam objectives covered in this chapter.
|Create and use types||Reflection. This includes finding, executing, and creating types at run time. Attributes. This includes creating, applying, ...|