示例#1
0
        /// <summary>
        /// Send the output to the specified target
        /// </summary>
        /// <param name="location"></param>
        /// <param name="queryReturnTarget"></param>
        /// <param name="value"></param>
        public static void SendOutput(string location,
                                      QueryResponseTarget.ReturnTargetType queryReturnTarget,
                                      object value)
        {
            if (null != value)
            {
                string valueAsJson = Newtonsoft.Json.JsonConvert.SerializeObject(value);
                switch (queryReturnTarget)
                {
                case QueryResponseTarget.ReturnTargetType.AzureBlobStorage:
                {
                    SendOutputToBlob(location, valueAsJson);
                    break;
                }

                case QueryResponseTarget.ReturnTargetType.CustomEventGridTopic:
                {
                    SendOutputToCustomTopic(location, valueAsJson);
                    break;
                }

                case QueryResponseTarget.ReturnTargetType.WebHook:
                {
                    SendOutputToWebhook(location, valueAsJson);
                    break;
                }

                case QueryResponseTarget.ReturnTargetType.DurableFunctionOrchestration:
                {
                    // TODO: Work out how to send output to trigger a durable function to awaken
                    break;
                }

                case QueryResponseTarget.ReturnTargetType.ServiceBus:
                {
                    // TODO : Send the output to a service bus endpoint
                    break;
                }

                case QueryResponseTarget.ReturnTargetType.SignalR:
                {
                    // TODO: Send the output to a SignalR endpoint
                    break;
                }

                case QueryResponseTarget.ReturnTargetType.NotSet:
                {
                    // Nothing to do here
                    break;
                }
                }
            }
        }
 public OutputLocationSet(SerializationInfo info, StreamingContext context)
 {
     Location   = info.GetString(nameof(Location));
     TargetType = (QueryResponseTarget.ReturnTargetType)info.GetValue(nameof(TargetType), typeof(QueryResponseTarget.ReturnTargetType));
 }
 public OutputLocationSet(string locationIn,
                          QueryResponseTarget.ReturnTargetType targetTypeIn)
 {
     Location   = locationIn;
     TargetType = targetTypeIn;
 }