Esempio n. 1
0
 public async Task Run([ServiceBusTrigger(
                            QueueName,
                            Connection = ServiceBusConstants.ConnectionStringConfigurationKey,
                            IsSessionsEnabled = true)] Message message)
 {
     await base.Run(message, async() =>
     {
         await _approveService.ApproveResults(message, batched: true);
     });
 }
Esempio n. 2
0
        public async Task WhenPartialFundingIsApproved(Table table)
        {
            Message message = new Message();

            string[] providerIds = table.AsStrings();
            PublishedProviderIdsRequest approveProvidersRequest = new PublishedProviderIdsRequest {
                PublishedProviderIds = providerIds
            };
            string approveProvidersRequestJson = JsonExtensions.AsJson(approveProvidersRequest);

            message.UserProperties.Add("user-id", _currentUserStepContext.UserId);
            message.UserProperties.Add("user-name", _currentUserStepContext.UserName);
            message.UserProperties.Add("specification-id", _currentSpecificationStepContext.SpecificationId);
            message.UserProperties.Add("jobId", _currentJobStepContext.JobId);
            message.Body = Encoding.UTF8.GetBytes(approveProvidersRequestJson);

            await _approveService.Run(message, async() =>
            {
                await _approveService.ApproveResults(message, batched: true);
            });
        }