public static async Task <InvocationMessage> FunctionAsync(this HttpRequestMessage request, AzureApplication application = default) { var invocationMessage = await request.InvocationMessageAsync(); var invocationMessageRef = invocationMessage.invocationRef; return(await await invocationMessage.StorageCreateAsync( async (created) => { var byteContent = invocationMessageRef.id.ToByteArray(); AzureApplication GetApplication() { if (!application.IsDefaultOrNull()) { return application; } var app = new AzureApplication(); app.ApplicationStart(); return app; } var applicationValid = GetApplication(); return await EastFive.Web.Configuration.Settings.GetString( AppSettings.FunctionProcessorQueueTriggerName, async(queueTriggerName) => { await applicationValid.SendQueueMessageAsync(queueTriggerName, byteContent); return invocationMessage; }, (why) => throw new Exception(why)); }, () => throw new Exception())); }
public static async Task <InvocationMessage> SendAsync <TResource>(this Task <InvocationMessage> invocationMessageTask, AzureApplication application = default) { var invocationMessage = await invocationMessageTask; var byteContent = invocationMessage.invocationRef.id.ToByteArray(); AzureApplication GetApplication() { if (!application.IsDefaultOrNull()) { return(application); } var app = new AzureApplication(); app.ApplicationStart(); return(app); } var applicationValid = GetApplication(); return(await EastFive.Web.Configuration.Settings.GetString( AppSettings.FunctionProcessorQueueTriggerName, async (queueTriggerName) => { await applicationValid.SendQueueMessageAsync(queueTriggerName, byteContent); return invocationMessage; }, (why) => throw new Exception(why))); }