A First Look at Dynamic Typing

Starting with C# 4.0, late-bound access to members is also available through dynamic typing. In such a case, the compiler has no idea about the existence of the selected members. This kind of behavior is desirable in various scenarios:

Image Objects may be totally typeless because they come from some dynamic language like Ruby or Python.

Image Data representations may not have a schema, like with Extensible Markup Language (XML) documents with no corresponding XML Schema Definition (XSD) schema.

You received some object back ...

Get C# 5.0 Unleashed 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.