Environment:
Windows 2008, VS 2008 SP1, asp.net Mvc RC1
Request Process Fragment:
The Controlleractioninvoker.invokeaction () method is invoked before the requested action is invoked, in which a reflectedactiondescriptor instance is constructed, This instance contains the descriptive information for the action.
Next, the Controlleractioninvoker.getparametervalues () method is invoked, by passing in the Reflectedactiondescriptor instance created before, Gets the action argument list (the corresponding instance of the Parameterdescriptor is created), and then iterates through the parameters, trying to get the value of the parameter, in the loop of the traversal, The Controlleractioninvoker.getparametervalue () method is invoked.
The following is the source code for the Controlleractioninvoker.getparametervalue () method:
Protected Virtual Object Getparametervalue (ControllerContext controllercontext, Parameterdescriptor Parameterdescriptor) {//collect all of the necessary binding properties Type ParameterType = P
Arameterdescriptor.parametertype;
Imodelbinder Binder = Getmodelbinder (parameterdescriptor);
idictionary<string, valueproviderresult> valueprovider = ControllerContext.Controller.ValueProvider;
String parametername = ParameterDescriptor.BindingInfo.Prefix??
Parameterdescriptor.parametername;
Predicate<string> propertyfilter = Getpropertyfilter (parameterdescriptor);
Finally, call into the binder modelbindingcontext BindingContext = new Modelbindingcontext () { Fallbacktoemptyprefix = (ParameterDescriptor.BindingInfo.Prefix = null),//Only fall back if Prefix not specifie D modelname = parametername, modelstate = COntrollerContext.Controller.ViewData.ModelState, Modeltype = ParameterType, propertyfilt
ER = propertyfilter, valueprovider = Valueprovider}; Object result = Binder.
Bindmodel (ControllerContext, BindingContext);
return result; }