Ejemplo n.º 1
0
        public async static Task InvokeAsyncWithBody <TResult>(
            this ClientTriggerCallback <TResult> callback,
            Runtime runtime,
            TResult result)
        {
            // This is a hack, and it doesn't feel sound, but it works.
            JObject values = new JObject();

            values.Add("body", JToken.FromObject(result));

            await callback.InvokeAsync(runtime, values).ConfigureAwait(false);
        }
Ejemplo n.º 2
0
 public async Task<HttpResponseMessage> Webhook(JArray events)
 {
     foreach (var e in events)
     {
         foreach (var c in CallbackStore)
         {
             var callback = new ClientTriggerCallback<JObject>(c.Value);
             await callback.InvokeAsync(Runtime.FromAppSettings(), e);
         }
     }
     return Request.CreateResponse(HttpStatusCode.OK);
 }
Ejemplo n.º 3
0
 public async Task <HttpResponseMessage> Webhook(JArray events)
 {
     foreach (var e in events)
     {
         foreach (var c in CallbackStore)
         {
             var callback = new ClientTriggerCallback <JObject>(c.Value);
             await callback.InvokeAsync(Runtime.FromAppSettings(), e);
         }
     }
     return(Request.CreateResponse(HttpStatusCode.OK));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Method to trigger the logic app.  Called when an event is recieved
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 /// <param name="runtime"></param>
 /// <param name="clientTriggerCallback"></param>
 private void sendTrigger(object sender, EventHubMessage e, Runtime runtime, ClientTriggerCallback <EventHubMessage> clientTriggerCallback)
 {
     clientTriggerCallback.InvokeAsync(runtime, e);
 }
 /// <summary>
 /// Method to trigger the logic app.  Called when an event is recieved
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 /// <param name="runtime"></param>
 /// <param name="clientTriggerCallback"></param>
 private void sendTrigger(object sender, EventHubMessage e, Runtime runtime, ClientTriggerCallback<EventHubMessage> clientTriggerCallback)
 {
     clientTriggerCallback.InvokeAsync(runtime, e);
 }