I recently posted a new version of my Advanced Controller
This is basically a Generic Controller (ASHX), which acts on ASP.net web formats as an MVC controller, in the sense that it receives a request and automatically calls the required internal method, parses its arguments from a querystring or params request depending on HTTP -verb and returns the result. It is much more, but it was the basic initial functionality.
Creating an object and hydrating from the request information was the most painful part of the project, but in the end I achieved the same performance as the same request made with the MVC.
As I said, .net MVC controllers actually do the same thing, but I never managed to find out how to do this.
For example, if I make this AJAX call in an MVC controller:
$.ajax({ type:'GET', url: 'SomeData/List' data:{filter: 'whatever'} });
This will call the controller method, which will receive the String filter property.
But it can become more complex, since we can call controllers that receive complex types, with complex types and collections nested and the โmagicallyโ arguments appear correctly parsed into the controller arguments.
Does anyone know how this plumbing works in .net MVC?
source share