Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Created Issue: Fix for issue in ActionDescriptor.ExtractParameterFromDictionary and System.Reflection.Missing type [725]

$
0
0
I'm using Castle Windsor to do various AOP stuff in my web application. I'm having an issue with a controller action method with an optional parameter with a default value:

public virtual ActionResult MyActionMethod(int? dummy=null) {}
public virtual ActionResult MyActionMethod(int? dummy=3) {}

Assume that the action is invoked without any matching parameters (e.g. http://host/MyController/MyActionmethod)

The issue is that when the controller action invoker tries to figure out what action to invoke on the controller it blows up at the call to ActionDescriptor.ExtractParameterFromDictionary because instead of a null or 3 value in the arguments it's parsing the argument is of type System.Reflection.Missing.

At this point the extractor should look to verify that the action is optional and has a default value and use that value rather than throw up. I don't think this behavior is incorrect -- Castle passing in System.Reflection.Missing -- and I don't think this is a bug with Castle because it's doing the semantically correct thing (the argument is actually missing).

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>