Beispiel #1
0
        /// <summary>
        /// Process a message that was written to the migration batches queue.
        /// </summary>
        /// <param name="message">An instance of <see cref="BrokeredMessage"/> that represents the message written to the queue.</param>
        /// <param name="log"></param>
        /// <returns>An instance of <see cref="Task"/> that represents the asynchronous operation.</returns>
        public static async Task ProcessMigrationBatchQueueMessageAsync([ServiceBusTrigger(MigrationConstants.MigrationBatchQueueName)] BrokeredMessage message, TextWriter log)
        {
            MigrationBatchEntity entity;
            IMigrationManager    manager;

            try
            {
                entity  = message.GetBody <MigrationBatchEntity>();
                manager = new MigrationManager(Program.Service);

                await manager.CreateMigrationBatchAsync(entity);
            }
            finally
            {
                entity  = null;
                manager = null;
            }
        }