WHAT’S IN THIS CHAPTER?
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
var keyword and anonymous methods started C# down the “dynamic” road. In version 4, the
dynamic type was added. Although C# is still a statically typed language, these additions give it the dynamic capabilities that some developers are looking for.
In this chapter, you’ll look at the
dynamic type and the rules for using it. You’ll also see what an implementation of
DynamicObject looks like and how it can be used.
ExpandoObject, which is the frameworks implementation of
DynamicObject, will also be covered.
The dynamic capabilities of C# 4 are part of the dynamic language runtime (DLR). The DLR is a set of services that is added to the common language runtime (CLR) to enable the addition of dynamic languages such as Ruby and Python. It also enables C# to take on some of the same dynamic capabilities ...