Reputation: 4622
As of ASP.net MVC 2 RC, there have been Async Controller available. There also various of ways and practice to make the async Controller.
For example:
for the first one, it is good to separate the module service with the controller, but there are some problem with the length to just do a method. For example, i want to have 2 method, which process differently and have different input like:
public void Test(string a) public string Test(string a, string b)
I will have to end up rewrite everything (IMO).
for the 2nd, it's good, and fast to write, we can easily turn a normal method into a Async method. But it might be not a good solution in some way.
What's your suggest of doing async controller. I could prioritize the shortness of a code (shorter = less bug), and also the one that can easily write as class module / plugin class (separate from main MVC code)
Please give your best advice :)
Upvotes: 3
Views: 1260
Reputation: 2956
There's a great article on Async Controllers by Dino Esposito. You can read it here: http://dotnetslackers.com/articles/aspnet/testing-asynchronous-methods-in-asp-net-mvc.aspx
Upvotes: 1