A controller method that calls a different method on the same controller

Posted by justSteve on Stack Overflow See other posts from Stack Overflow or by justSteve
Published on 2010-05-21T00:45:01Z Indexed on 2010/05/21 0:50 UTC
Read the original article Hit count: 242

Filed under:
|

I have a controller method:

  public ActionResult Details(int id)
  {
      Order order = OrderFacade.Instance.Load(id);
      return View(order);
  }

that is used for 95% of possible invocations. For the other 5% i need to manipulate the value of id before passing to the facade. I'd like to create a separate method within this same controller that executes that manipulation and then calls this (Details) method.

What would the signature of that method look like? What is the syntax to call the main Details method?

public ??? ManipulatorMethod(int id)
{
    [stuff that manipulates id]

    [syntax to call Details(manipulatedID)]
}

mny thx

© Stack Overflow or respective owner

Related posts about c#

Related posts about asp.net-mvc-2