private void AssignValue(string queryParam, ActionArgumentDescriptor actionParam)
 {
     try
     {
         actionParam.ParamValue = Convert.ChangeType(queryParam, actionParam.ParamType);
     }
     catch(FormatException e)
     {
         throw new FormatException("Failed to bind parameter " + actionParam.ParamName + " of type " + actionParam.ParamType.Name + ". Query string value: " + queryParam);
     }
 }
        private void BindParameter(IDictionary<string, string> queryParameters, ActionArgumentDescriptor actionParam)
        {
            if (actionParam.ParamValue != null)
                return;

            var queryParam = queryParameters.Any(p => p.Key.Equals(actionParam.ParamName, StringComparison.OrdinalIgnoreCase)) ? queryParameters[actionParam.ParamName] : null;

            var isNullableActionParam = !actionParam.ParamType.IsValueType || (Nullable.GetUnderlyingType(actionParam.ParamType) != null);
            if ((queryParam == null && isNullableActionParam))
                return;
            else if (queryParam == null && !isNullableActionParam)
                throw new Exception("Failed to bind parameter " + actionParam.ParamName + " of type " + actionParam.ParamType);
            else
                AssignValue(queryParam, actionParam);
        }