In Version 3.5, .NET introduced the
var keyword. With
var, developers got the choice of not declaring the type of the variable. It became the task of the compiler to infer the type of the variable based on the value assigned. .NET 4.0 took this concept a step ahead by introducing the keyword
When a variable is declared
dynamic, its type is inferred only during execution. The compiler does not check for the type and type safety of a
dynamic variable. This helps a lot when dealing with data whose type is either unknown or too complex to be bound to a compiled object. In this recipe, you will see how
dynamic can access parsed JSON data without creating classes for the JSON elements. One thing to keep ...