VB.NET/ASP.NET With and New keyword muddle
asp.net-mvc, linq, vb.net
Solution
This syntax is used to create an anonymous type in VB.Net.
It allows you to define a type on the fly with a set of name / value pairs. The names all turn into properties on the type. If you open up the generated assembly in reflector you will be able to see these types.
Don't let the With syntax portion fool you. This feature has nothing to do with the "With" context feature of VB.Net. Other than the "." prefix on the value names.
Problem
Can someone explain how `New` works with the `With` keyword in this example from the MVC framework. ``` routes.MapRoute("Default", "{controller}/{action}/{id}", New With {.controller = "Home", .action = "Index", .id = ""}) ```