In mvc, you can pass arguments like so
new { A = B, C= "D", E ="F", ... }
I'd like to pass arguments like so to my own procedures, looking for links to any samples/tutorial for the same
thanks
In mvc, you can pass arguments like so
new { A = B, C= "D", E ="F", ... }
I'd like to pass arguments like so to my own procedures, looking for links to any samples/tutorial for the same
thanks
You should look into anonymous types and reflection in C#.
In short:
If you're not using ASP.NET MVC then you'll need to use reflection in your method as stated in an answer above, but if you're writing an ASP.NET MVC extension method you can use
HtmlHelper method called AnonymousObjectToHtmlAttributes
which creates RouteValueDictionary
from anonymous object or use RouteValueDictionary constructor that takes anonymous object to initialize its values.