c# - Question about use of new { } -


I am currently working my way through the Apress ASP.NET MVC2 book, and I am a little as a user Confused: new {returnUrl} :

  PUBLIC READYRICATERouterResult RemovePromact (cart cart, int product ID, string return url) {product product = products repository.products . FirstOver Default (P => P. produced == Product ID); Cart.RemoveLine (product); Return Redirect Tax ("index", new {returnUrl}); }   

Is it anything to create a new string instead of passing the reference of the passed parameter?

This is creating an anonymous type with a property returnUrl Em> value is the returnUrl . So it is like this:

  var anon = new {returnUrl = returnUrl}; Return redirect rate ("index", return);   

Using a name from expression to name the asset in an unknown type is called launch launcher .

Will you explain it to everyone? If not, you may want to make amendments in general. They were introduced in C # 3, which were mostly for LINQ.

Comments