Note that there are some explanatory texts on larger screens.

plurals
  1. POthunderdome action invoker asp.net mvc
    primarykey
    data
    text
    <p>I know basic idea of thunderdome principle (one object enters, one object leaves) but I didn't see any real world example of it in asp.net mvc. Is it good example of thunderdome principle</p> <pre><code> public ActionResult Index(Employee employee) { //some actions here return View(employeeViewModel); } </code></pre> <p>But what about statement </p> <blockquote> <p>The Controller classes will NEVER be directly exposed to anything related to HttpContext</p> </blockquote> <p>How the action invoker should looks like ? Could You provide some examples and unit tests for it ?</p> <hr> <p>from <a href="http://codebetter.com/blogs/jeremy.miller/archive/2008/10/23/our-opinions-on-the-asp-net-mvc-introducing-the-thunderdome-principle.aspx" rel="nofollow noreferrer">http://codebetter.com/blogs/jeremy.miller/archive/2008/10/23/our-opinions-on-the-asp-net-mvc-introducing-the-thunderdome-principle.aspx</a></p> <p>The “Thunderdome Principle” – All Controller methods take in one ViewModel object (or zero objects in some cases) and return a single ViewModel object (one object enters, one object leaves). The Controller classes will NEVER be directly exposed to anything related to HttpContext. Nothing makes me cry like seeing people trying to write tests that mock or stub that new IHttpContextWrapper interface. Likewise, Controller methods do not return ViewResult objects and are generally decoupled from all MVC infrastructure. We adopted this strategy very early on as a way to make Controller testing simpler mechanically.</p> <p>But i want to know how to do this ? how to write such controller action invoker ? becouse normally we have to mock httpcontext</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload