Appendix A. C# and VB.NET Language Features

ASP.NET MVC takes advantage of many advanced features of the C# and VB.NET languages. Some of these features were not introduced into these languages until C# 3.0 and Visual Basic 9.0. This appendix provides you with a brief overview of these new language features.

Type Inference

Both C# and Visual Basic can infer the type of a variable when you create a local variable. For example, the following line of code creates a new string variable named message with the value "Hello World!":

(C#)

var message = "Hello World!";

(VB)

Dim message = "Hello World!" ...

Get ASP.NET MVC Framework 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.