Пример #1
0
 private void ResolveQuestionFromRouting(ref IExecutionResult executionResult, ref IExecuteRequest executeRequest)
 {
     try
     {
         var missingParameters = executionResult.Questions?.Parameters;
         var type = executionResult.Questions?.Parameters.Select(p => p.Type);
         foreach (var missingParameter in missingParameters)
         {
             var missingParameterName = missingParameter.Name;
             var missingParameterType = missingParameter.Type;
             if (MissingParameterHasRouting(missingParameterName))
             {
                 var value = Task.Run(async() => await _routingController.GetParameterValue(missingParameterName)).Result;
                 if (value == null)
                 {
                     continue;
                 }
                 var parameter = new ClientParameter(missingParameterName, value, missingParameterType, missingParameterName);
                 executeRequest.Parameters.Add(parameter);
                 executionResult = Execute(executeRequest);
             }
         }
     }
     catch
     {
         return;
     }
 }
Пример #2
0
        private void ResolveQuestionFromRouting(ref IExecutionResult executionResult, ref IExecuteRequest executeRequest)
        {
            var missingParameterName = executionResult.QuestionFirstParameter?.Name;

            if (MissingParameterHasRouting(missingParameterName))
            {
                var value = _routingController.GetParameterValue(missingParameterName);
                if (value == null)
                {
                    return;
                }
                //var parameter = new RoutingParameter(missingParameterName, value);
                var parameter = new ClientParameter(missingParameterName, value, TypeInference.InferenceResult.TypeEnum.Unknown, missingParameterName);
                executeRequest.Parameters.Add(parameter);
                executionResult = Execute(executeRequest);
            }
        }