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); }
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); }
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)); }
/// <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); }