Chapter 17. Dynamic Types

Throughout this book, I have emphasized the importance of type and type safety. After all, C# is a strongly typed language, and you are most effective when you use the C# type system along with the compiler to eliminate any programming errors early at compile time rather than later at run time. However, there are some areas where the static, strongly-typed nature of C# creates headaches. Those areas often involve interoperability. In this chapter, I will introduce you to the dynamic type (which is new in C# 4.0) and discuss what it means from both a language standpoint as well as a runtime standpoint.

What does dynamic Mean?

In a nutshell, dynamic is a static type that you can use where you would use any other static type. ...

Get Accelerated C# 2010 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.