/// <summary> /// Adds alert messages to an Azure Storage queue. This allows alerts to be sent as a summary /// of events within a given period of time, as defined in the <see cref="Settings"/>. /// </summary> /// <param name="alert">The alert to queue.</param> /// <returns></returns> protected async Task QueueTripAlert(LogicAppAlert alert) { // Use the QueueResolver to retrieve a reference to the Azure Storage queue. var alertsQueue = _queueResolver.GetQueue(WellKnown.StorageQueues.AlertQueueName); // Create a message and add it to the queue. var message = new CloudQueueMessage(JsonConvert.SerializeObject(alert)); await alertsQueue.AddMessageAsync(message); }
public async Task <IEnumerable <TodoItem> > GetAllAsync() { await _queueResolver.GetQueue(AzureQueues.EmailQueue).AddMessageAsync(new CloudQueueMessage("{Name: \"Toby\"}")); return(await _dbContext.TodoItems.ToListAsync()); }