RFC - Removing ActionMethod property from Action Filter Contexts

Last post 08-05-2008 3:29 PM by SteveSanderson. 4 replies.

Sort Posts:

  • RFC - Removing ActionMethod property from Action Filter Contexts

    08-05-2008, 2:40 PM
    • Contributor
      5,773 point Contributor
    • Haacked
    • Member since 09-17-2003, 2:43 PM
    • Posts 388

    Hey all, I need to get your feedback on something. We want to remove the ActionMethod property on Action Filter Contexts, but want to get a sense if that would cause problems for anyone. Most of the information you get from the property is available to you via the RouteValueDictionary. The reason for the proposed change is we might want to change the mechanism from reflection to something else in the future. By having a property of type MethodInfo there now, we bake that signature into the context. We don't have time to do the full change we'd like now, so it'd be better if we simply removed the property and added it back later with the proper signature. Any strong objections?

    Phil Haack (http://haacked.com/)
    Senior Program Manager, Microsoft

    What wouldn’t you do for a Klondike bar?
  • Re: RFC - Removing ActionMethod property from Action Filter Contexts

    08-05-2008, 2:46 PM
    • Contributor
      2,087 point Contributor
    • subdigital
    • Member since 08-11-2004, 4:02 PM
    • Houston
    • Posts 441
    • ASPInsiders

    I think that's a no-brainer.  Make the switch.  It means decoupling yourself from implementation details (ie:  getting action name from reflection) and improving the framework.  The change on our end would be pretty small.

    Given the route values we could always reflect and get our own MethodInfo if we were totally dependent on it.
     

    Ben Scheirman
    http://www.flux88.com

    ASP.NET MVP
    Certified ScrumMaster
    ASPInsider
    MCSD
  • Re: RFC - Removing ActionMethod property from Action Filter Contexts

    08-05-2008, 2:51 PM
    • Member
      506 point Member
    • JeremyS
    • Member since 10-21-2006, 8:23 AM
    • UK
    • Posts 99
    I say go for it.

    I just did a quick search through the mvccontrib code, and the only place I've ever used it is to determine the name of the action being executed, but as you say this can easily be extracted from the routedata instead.
  • Re: RFC - Removing ActionMethod property from Action Filter Contexts

    08-05-2008, 2:55 PM

     I see no real need for it.  Nuke it.

     I am all for breaking changes in future releases if it is for the better.

  • Re: RFC - Removing ActionMethod property from Action Filter Contexts

    08-05-2008, 3:29 PM

    There is the edge case where you're using a custom ControllerActionInvoker to select action methods, and then you couldn't necessarily determine which action method had been selected just by looking at RouteData. Still, I can't imagine a realistic scenario where this would be an unsolveable problem.

    Sounds like a sensible change to me. No objections!

Page 1 of 1 (5 items)